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.