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

Automation issue, cacti 1.1.2 - api_automation.php #520 #534

Closed
JorisFRST opened this issue Apr 7, 2017 · 1 comment
Closed

Automation issue, cacti 1.1.2 - api_automation.php #520 #534

JorisFRST opened this issue Apr 7, 2017 · 1 comment

Comments

@JorisFRST
Copy link

When selecting : Show Matching Objects. Following error is in the log :
(Also impossible to create graphs with automation)

2017-04-07 11:04:53 - CMDPHP SQL Backtrace: (/automation_graph_rules.php: 74 automation_graph_rules_edit)(/automation_graph_rules.php: 607 display_new_graphs)(/lib/api_automation.php: 798 db_fetch_assoc)(/lib/database.php: 320 db_fetch_assoc_prepared)(/lib/database.php: 359 cacti_debug_backtrace)
2017-04-07 11:04:53 - DBCALL ERROR: SQL Assoc Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Index FROM host_snmp_cache AS hsc LEFT JOIN host AS h ON (hsc.host_id=h.id) L' at line 1
2017-04-07 11:04:53 - DBCALL ERROR: SQL Assoc Failed!, Error:1064, SQL:"SELECT * FROM (SELECT h.hostname AS automation_host, host_id, h.disabled, h.status, snmp_query_id, snmp_index , MAX(CASE WHEN field_name='CPUPhIndex' THEN field_value ELSE NULL END) AS CPUPhIndex, MAX(CASE WHEN field_name='Index' THEN field_value ELSE NULL END) AS Index FROM host_snmp_cache AS hsc LEFT JOIN host AS h ON (hsc.host_id=h.id) LEFT JOIN host_template AS ht ON (h.host_template_id=ht.id) WHERE snmp_query_id=13 AND ( h.hostname NOT LIKE '' ) GROUP BY host_id, snmp_query_id, snmp_index) AS a LIMIT 0,30"
2017-04-07 11:04:53 - CMDPHP SQL Backtrace: (/automation_graph_rules.php: 74 automation_graph_rules_edit)(/automation_graph_rules.php: 607 display_new_graphs)(/lib/api_automation.php: 790 db_fetch_assoc)(/lib/database.php: 320 db_fetch_assoc_prepared)(/lib/database.php: 359 cacti_debug_backtrace)
2017-04-07 11:04:53 - DBCALL ERROR: SQL Assoc Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Index FROM host_snmp_cache AS hsc LEFT JOIN host AS h ON (hsc.host_id=h.id) L' at line 1
2017-04-07 11:04:53 - DBCALL ERROR: SQL Assoc Failed!, Error:1064, SQL:"SELECT * FROM (SELECT h.hostname AS automation_host, host_id, h.disabled, h.status, snmp_query_id, snmp_index , MAX(CASE WHEN field_name='CPUPhIndex' THEN field_value ELSE NULL END) AS CPUPhIndex, MAX(CASE WHEN field_name='Index' THEN field_value ELSE NULL END) AS Index FROM host_snmp_cache AS hsc LEFT JOIN host AS h ON (hsc.host_id=h.id) LEFT JOIN host_template AS ht ON (h.host_template_id=ht.id) WHERE snmp_query_id=13 AND ( h.hostname NOT LIKE '' ) GROUP BY host_id, snmp_query_id, snmp_index) AS a "

cigamit added a commit that referenced this issue Apr 7, 2017
Automation issues with 'AS' clause using keyword
@cigamit
Copy link
Member

cigamit commented Apr 7, 2017

I think it got it this time.

@cigamit cigamit closed this as completed Apr 7, 2017
@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants