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

Missing 'getSNMPQueries()' function when calling add_data_query.php #2452

dumporama opened this issue Feb 25, 2019 · 1 comment
bug Undesired behaviour CLI CLI related issue resolved A fixed issue


Copy link

Hi I'm new here, I hope this bug report is described okay.

Describe the bug
When running add_data_query.php via CLI I get the below error:
Cacti version 1.2.1

Fatal error: Uncaught Error: Call to undefined function getSNMPQueries() in C:\Apache24\htdocs\cacti\cli\add_data_query.php:138
Stack trace:
#0 {main}
  thrown in C:\Apache24\htdocs\cacti\cli\add_data_query.php on line 138

To Reproduce
php -q add_data_query.php --list-data-queries

Expected behavior
expected to return a list of available data queries


Desktop (please complete the following information):
cygwin on windows, command line

Additional context

getSNMPQueries() is a function of api_automation_tools.php but this file hasn't been included in add_data_query.php

If I add the following line:
require_once($config['base_path'] . '/lib/api_automation_tools.php');
then add_data_query.php seems to operate as expected and doesn't throw a fatal error.

$ php -q add_data_query.php --list-data-queries
Known SNMP Queries: (id, name)
1       SNMP - Interface Statistics
2       Unix - Get Mounted Partitions
3       Net-SNMP -  Get Monitored Partitions
4       SNMP - Get Mounted Partitions
5       SNMP - Get Processor Information
6       Net-SNMP - Get Device I/O
netniV added a commit that referenced this issue Feb 26, 2019
Add missing include to api_automation_tools.php
@netniV netniV added bug Undesired behaviour resolved A fixed issue CLI CLI related issue labels Feb 26, 2019
Copy link

netniV commented Feb 26, 2019

This is now in the main development code, please check and close if issue is resolved.

@netniV netniV added this to the Cacti 1.2.3 milestone Feb 26, 2019
@cigamit cigamit closed this as completed Mar 3, 2019
@netniV netniV changed the title Fatal Error when running add_data_query.php via CLI Missing 'getSNMPQueries()' function when calling add_data_query.php Mar 30, 2019
@github-actions github-actions bot locked as resolved 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.
bug Undesired behaviour CLI CLI related issue resolved A fixed issue
None yet

No branches or pull requests

3 participants