I have a big problem here. It was noticed that a few of our graphs were acting strangely, showing odd peaks and valleys between polling runs. After confirming that the data was correct the problem led me to the maximum value allowed in the data source template for these graphs. When I looked at the template this is where my nightmare started.
There are several templates with this problem (but not all of them) the most serious of which is the "Interface - Traffic" template (ID=41) which has around 4000 data sources using it.
When an affected template is clicked on in the web GUI the following errors appear in the cacti log:
Code: Select all
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_template_id in file: /usr/share/cacti/site/data_templates.php on line: 607
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[607]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_template_id in file: /usr/share/cacti/site/data_templates.php on line: 607
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[607]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_template_id in file: /usr/share/cacti/site/data_templates.php on line: 607
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[607]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_template_id in file: /usr/share/cacti/site/data_templates.php on line: 607
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[607]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_template_id in file: /usr/share/cacti/site/data_templates.php on line: 607
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[607]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_sources in file: /usr/share/cacti/site/data_templates.php on line: 661
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[661]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_sources in file: /usr/share/cacti/site/data_templates.php on line: 661
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[661]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_input_id in file: /usr/share/cacti/site/data_templates.php on line: 739
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[739]:CactiErrorHandler())
2020/03/12 18:39:32 - ERROR PHP NOTICE: Undefined index: data_input_id in file: /usr/share/cacti/site/data_templates.php on line: 744
2020/03/12 18:39:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_templates.php[67]:template_edit(), /data_templates.php[744]:CactiErrorHandler())
Affected templates exhibit the same symptoms:
1. The Name field is empty
2. Data input method shows as "None" and is greyed out
3. The data source profile is wrong. Three are configured in this system and the data sources currently using this template are not using the profile shown here.
4. The data source items are correct
5. There's nothing under "Custom Data" due to #2
Any attempt to fix/change and save these values results in cacti creating a "copy" of the template under a new ID rather then updating the broken template. When the list is refreshed and the broken template opened again it is unchanged.
I spent a couple of hours digging around in the database trying to find out what was broken but I was not successful. With 4000 data sources using this one template (not counting the others) deleting them all and recreating them and the associated data/rrds is not an option for me - so I'm really hoping someone can help.
I'm not afraid to get my hands dirty in the database...
Thanks