Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs when Creating New Graphs through Automatically Added Devices using Sync Device Template #3209

Closed
danfiscus opened this issue Jan 22, 2020 · 3 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@danfiscus
Copy link

I have a number of devices which were automatically added through AUTOM8 and a lot of them are Cisco Switches. I have a device automation rule set up to detect a string in the SNMP description and apply the Cisco Switch device template, all of which is working fine. However, I made a change to the device template (I don't recall exactly what, but it may have been increasing the max OIDs per get request?) and when I used the Sync to Device Template option in the Devices manager, it ran through plenty of data sources that were already properly graphed with no issue, but when it got to a new data source in need of a graph, the web page stopped responding and these errors appeared in cacti.log:

2020/01/22 15:10:35 - ERROR PHP ERROR: Uncaught Error: Call to undefined function api_tree_graph_exists() in /var/www/html/cacti/lib/api_automation.php:2794 Stack trace: #0 /var/www/html/cacti/lib/api_automation.php(2387): create_graph_node('5347', '46', Array) #1 /var/www/html/cacti/lib/api_automation.php(2138): automation_execute_graph_create_tree('5347') #2 /var/www/html/cacti/lib/template.php(1337): automation_hook_graph_create_tree(Array) #3 /var/www/html/cacti/lib/api_automation.php(2511): create_complete_graph_from_template('36', '55', Array, Array) #4 /var/www/html/cacti/lib/api_automation.php(2199): create_dq_graphs('55', '4', Array) #5 /var/www/html/cacti/lib/data_query.php(379): automation_execute_data_query('55', '4') #6 /var/www/html/cacti/lib/api_device.php(861): run_data_query('55', '4') #7 /var/www/html/cacti/lib/api_device.php(955): api_device_update_host_template('55', '12') #8 /var/www/html/cacti/host_templates.php(227): api_device_template_sync_template('12') #9 /var/www/html/cacti/host_templates.php(49): form_actions() #10 {ma in file: /var/www/html/cacti/lib/api_automation.php on line: 2794
2020/01/22 15:10:35 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())

Now, I'm admittedly a bit new to Cacti and there's a chance I'm doing something wrong here, but as best as I can tell, I am able to reproduce this issue each time I attempt to sync devices to the template. I am happy to provide more information if needed, but I wasn't sure what else to include in this bug report. I am on the latest version of Cacti as of this post.

TheWitness added a commit that referenced this issue Jan 23, 2020
* Devices still show in cacti despite being deleted
* PHP Error when Creating New Graphs through Automatically Added Devices using Sync Device Template
@TheWitness
Copy link
Member

You should only have to update host_templates.php from the GitHub. However, the rest of the changes are safe as well. Thanks for reporting.

@TheWitness TheWitness added bug Undesired behaviour resolved A fixed issue labels Jan 23, 2020
@TheWitness TheWitness added this to the v1.2.9 milestone Jan 23, 2020
@danfiscus
Copy link
Author

Wow, that was some quick work! Thanks @TheWitness, I will go ahead and update this file when I am at work next and report back

@danfiscus
Copy link
Author

UPDATE: the new file was installed and no longer has the issue, all clear on my end!

@netniV netniV changed the title PHP Error when Creating New Graphs through Automatically Added Devices using Sync Device Template Error occurs when Creating New Graphs through Automatically Added Devices using Sync Device Template Feb 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants