Cacti: adding a graph produces ‘Unknown snmp-value for field ifName’

cacti

I'm adding a graph using the cli tool add_graph.php. Here is an example command line:

/usr/bin/php -q /usr/share/cacti/cli/add_graphs.php --host-id=34  --graph-type=ds --graph-template-id=31 --snmp-query-id=1  --snmp-query-type-id=20 --snmp-field=ifName --snmp-value=Vl1239

Intermittently I get this error:

ERROR: Unknown snmp-value for field ifName - Vl1239

Looking through the code this means that this value does not appear in any entry in the table host_snmp_cache for this host. It also appears that the way to re-populate that table for a host is this:

/usr/bin/php -q /usr/share/cacti/cli/poller_reindex_hosts.php -id=34

But it doesn't work. The ifName Vl1239 is still missing, but it's definitely there on the host. Other interfaces also on the host get added without error.

Any ideas?

Best Answer

I found the answer to this and it has nothing to do with Cacti. The router was failing to supply all the virtual interfaces when queried by the reindexer. The reason for this has something to do with the CPU on the switch blade being pegged at 100% as a result of a spanning tree error. Fixed the error, CPU came down to 1%, snmp responses are now accurate.