Quite often, there is a interface migration on several switches on my infrastructure, for example the interface GigabitEthernet1/2 becomes GibabitEthernet1/3.
The thing is that I have to update our Cacti according to this change with two constraints :
- keeping the previous history of the interface
- keeping the same graph id (we are generating reports by downloading pngs according the the graph id)
Code: Select all
DELETE FROM poller_item WHERE local_data_id='$RRD_ID'"
UPDATE data_local SET snmp_index='$SNMP_ID' WHERE id='$RRD_ID'"
UPDATE graph_local SET snmp_index='$SNMP_ID' WHERE id='$GRAPH_ID'"
- $RRD_ID = the data source id associated to the RRD
- $SNMP_ID = the new SNMP_ID found in the table "host_snmp_cache"
- $GRAPH_ID = the graph associated to the data source
Code: Select all
php cli/poller_data_sources_reapply_names.php --id=$HOST_ID
php cli/poller_graphs_reapply_names.php -id=$HOST_ID
php cli/rebuild_poller_cache.php
I'm pretty sure I missed to update a table entry with the new SNMP index but I have not yet found it.
Is anyone facing the same problem or is there a better/cleaner way to do it ?
Thank you in advance for your answer.