[Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
tjswe
Posts: 6
Joined: Wed Mar 15, 2017 2:28 am

[Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by tjswe »

Running a fresh install of Cacti 1.1.2 and trying to create a graph rule.

The query below is just "h.hostname is not empty" in the device selection criteria under "Automation" --> "Graph rules"

2017-04-04 11:06:30 - 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-04 11:06:30 - DBCALL ERROR: SQL Assoc Failed!, Error: Unknown column 'h.hostname' in 'where clause'
2017-04-04 11:06:30 - DBCALL ERROR: SQL Assoc Failed!, Error:1054, SQL:"SELECT * FROM (SELECT h.hostname AS automation_host, host_id, h.disabled, h.status, snmp_query_id, snmp_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=1 AND ( `h.hostname` NOT LIKE '' ) GROUP BY host_id, snmp_query_id, snmp_index ORDER BY automation_host, CAST(snmp_index AS unsigned)) AS a LIMIT 0,30"

Running
CentOS Linux release 7.3.1611
Apache/2.4.6 (CentOS) PHP/5.4.16
Mariadb 5.5.52

I had this briefly working on 1.1.0. Could it be in relation to issue#499?

Please get back if more details are needed!
User avatar
Cramin
Posts: 23
Joined: Mon Mar 06, 2017 4:06 pm
Contact:

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by Cramin »

The same problem, 1.1.0 and 1.1.2
Some rules work, some not.
Cisco is not working
Image

Code: Select all

2017-04-04 14:51:02 - CMDPHP SQL Backtrace: (/automation_graph_rules.php: 74 automation_graph_rules_edit)(/automation_graph_rules.php: 600 display_matching_hosts)(/lib/api_automation.php: 260 db_fetch_assoc)(/lib/database.php: 320 db_fetch_assoc_prepared)(/lib/database.php: 359 cacti_debug_backtrace)
2017-04-04 14:51:02 - DBCALL ERROR: SQL Assoc Failed!, Error: Unknown column 'h.description' in 'where clause'
2017-04-04 14:51:02 - DBCALL ERROR: SQL Assoc Failed!, Error:1054, SQL:"SELECT h.id AS host_id, h.hostname, h.description, h.disabled, h.status, ht.name AS host_template_name FROM host AS h LEFT JOIN host_template AS ht ON (h.host_template_id=ht.id) WHERE ( `h.description` IS NOT NULL ) ORDER BY description ASC LIMIT 0,30"
2017-04-04 14:51:02 - CMDPHP SQL Backtrace: (/automation_graph_rules.php: 74 automation_graph_rules_edit)(/automation_graph_rules.php: 600 display_matching_hosts)(/lib/api_automation.php: 250 db_fetch_assoc)(/lib/database.php: 320 db_fetch_assoc_prepared)(/lib/database.php: 359 cacti_debug_backtrace)
2017-04-04 14:51:02 - DBCALL ERROR: SQL Assoc Failed!, Error: Unknown column 'h.description' in 'where clause'
2017-04-04 14:51:02 - DBCALL ERROR: SQL Assoc Failed!, Error:1054, SQL:"SELECT h.id AS host_id, h.hostname, h.description, h.disabled, h.status, ht.name AS host_template_name FROM host AS h LEFT JOIN host_template AS ht ON (h.host_template_id=ht.id) WHERE ( `h.description` IS NOT NULL )" 
DLink is working
Image
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by Osiris »

Man, that sucks.
Before history, there was a paradise, now dust.
tjswe
Posts: 6
Joined: Wed Mar 15, 2017 2:28 am

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by tjswe »

Issue seems to be resolved in issue #520 https://github.com/Cacti/cacti/issues/520

Rules are working again.

I replaced current lib/api_automation.php with the latest at Github.
User avatar
Cramin
Posts: 23
Joined: Mon Mar 06, 2017 4:06 pm
Contact:

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by Cramin »

Thank You!
User avatar
JorisFRST
Cacti User
Posts: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by JorisFRST »

Thanks,
was having the same issue.
Joris.
http://www.routerjanitor.com
jhonnyx
Cacti User
Posts: 87
Joined: Sun Feb 26, 2017 10:33 am

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by jhonnyx »

tjswe wrote:Issue seems to be resolved in issue #520 https://github.com/Cacti/cacti/issues/520

Rules are working again.

I replaced current lib/api_automation.php with the latest at Github.
Hi,

How do I apply this patch? :(
jozatan
Posts: 11
Joined: Sun Apr 09, 2017 1:10 am
Location: San Diego, CA

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by jozatan »

jhonnyx wrote:
tjswe wrote:Issue seems to be resolved in issue #520 https://github.com/Cacti/cacti/issues/520

Rules are working again.

I replaced current lib/api_automation.php with the latest at Github.
Hi,

How do I apply this patch? :(
Well a way is to download

https://github.com/Cacti/cacti/blob/dev ... mation.php

and manually to replace it with the one in

/usr/share/cacti/lib/api_automation.php
jhonnyx
Cacti User
Posts: 87
Joined: Sun Feb 26, 2017 10:33 am

Re: [Cacti 1.1.2] SQL-error in automation_graph_rules.php

Post by jhonnyx »

jozatan wrote:
jhonnyx wrote:
tjswe wrote:Issue seems to be resolved in issue #520 https://github.com/Cacti/cacti/issues/520

Rules are working again.

I replaced current lib/api_automation.php with the latest at Github.
Hi,

How do I apply this patch? :(
Well a way is to download

https://github.com/Cacti/cacti/blob/dev ... mation.php

and manually to replace it with the one in

/usr/share/cacti/lib/api_automation.php
Right, :D what did I ask???

thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest