"SQL Exec Failed" for table 'host'

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
MaffooClock
Posts: 17
Joined: Wed Jul 12, 2006 11:25 pm

"SQL Exec Failed" for table 'host'

Post by MaffooClock »

I have the following log entry for every poller run:

Code: Select all

03/14/2007 09:20:05 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "update host set  status = '3',  status_event_count = '2',  status_fail_date = '2007-03-13 08:57:33',  status_rec_date = '0000-00-00 00:00:00',  status_last_error = 'SNMP not performed due to setting or ping result., default',  min_time = '0.20500',  max_time = '3482.27000',  cur_time = '0.36752',  avg_time = '116.06163',  total_polls = '44247',  failed_polls = '2',  availability = '99.9954799195'  where hostname = 'melbourne.divergentsystems.com'"
It appears the data for column 'status_last_error' is what's causing this. I executed the same query manually, but without the ", default" portion for said column, and the query executed fine.

While I'm working on this, I also need to figure out why this host is being deemed down when an snmpwalk returns data fine. But that's another thread...
MaffooClock
Posts: 17
Joined: Wed Jul 12, 2006 11:25 pm

Post by MaffooClock »

Found it! Line 463 of functions.php:

Code: Select all

 458         /* determine the error message to display */
 459         if ($ping_availability == AVAIL_SNMP_AND_PING) {
 460             if ($hosts[$host_id]["snmp_community"] == "") {
 461                 $hosts[$host_id]["status_last_error"] = $ping->ping_response;
 462             }else {
 463                 $hosts[$host_id]["status_last_error"] = $ping->snmp_response . ", " . $ping->ping_response;
 464             }
 465         }elseif ($ping_availability == AVAIL_SNMP) {
 466             if ($hosts[$host_id]["snmp_community"] == "") {
 467                 $hosts[$host_id]["status_last_error"] = "Device does not require SNMP";
 468             }else {
 469                 $hosts[$host_id]["status_last_error"] = $ping->snmp_response;
 470             }
 471         }else {
 472             $hosts[$host_id]["status_last_error"] = $ping->ping_response;
 473         }

The column 'status_last_error' is limited to 50 characters, but the query is trying to insert 58 characters. So, is this a bona fide bug in Cacti? Before I toss an invalid bug into Mantis, I'd liek to see what others think...
MaffooClock
Posts: 17
Joined: Wed Jul 12, 2006 11:25 pm

Post by MaffooClock »

Unable to find any existing bug reports in Mantis, bug 934 has been filed.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest