Cacti don't update field status_fail_date and status_rec_dat

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

Moderators: Developers, Moderators

Post Reply
User avatar
dragossto
Cacti User
Posts: 86
Joined: Tue May 15, 2007 5:24 am
Location: Romania
Contact:

Cacti don't update field status_fail_date and status_rec_dat

Post by dragossto »

status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00'
initial fresh install gentoo cacti 0.8.8 e , update manual to latest version0.8.8h
the problem it is the same
cacti don't populate the field

from debug log ( one row before and after host ip )
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] Host[9] PING: ICMP Ping Success (0.389 ms)
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "update host set status = '2', status_event_count = '2', status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00', status_last_error = 'ICMP ping Timed out', min_time = '0.29300', max_time = '25.03000', cur_time = '0.389', avg_time = '0.46180629691791', total_polls = '19666', failed_polls = '4', availability = '99.979660327469' where hostname = '80.96.114.3'"
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "select poller_reindex.data_query_id, poller_reindex.action, poller_reindex.op, poller_reindex.assert_value, poller_reindex.arg1 from poller_reindex where poller_reindex.host_id=9"
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
05/09/2016 02:39:03 PM - PHPSVR: Poller[0] DEBUG: PID[13781] CTR[1] INC: 'ss_fping.php' FUNC: 'ss_fping' PARMS: '80.96.114.3 4 ICMP'
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
--
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
05/09/2016 02:39:03 PM - PHPSVR: Poller[0] DEBUG: PID[13781] CTR[1] RESPONSE:'min:0.3310 avg:0.3472 max:0.3640 dev:0.0122 loss:0.0000'
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] Host[9] DS[102] SERVER: /var/www/localhost/htdocs/cacti/scripts/ss_fping.php ss_fping 80.96.114.3 4 ICMP , output: min:0.3310 avg:0.3472 max:0.3640 dev:0.0122 loss:0.0000
05/09/2016 02:39:03 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (102, '', '2016-05-09 14:39:03', 'min:0.3310 avg:0.3472 max:0.3640 dev:0.0122 loss:0.0000')"
--
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] Host[9] NOTICE: HOST EVENT: Host Returned from DOWN State:
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "update host set status = '3', status_event_count = '0', status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00', status_last_error = 'ICMP ping Timed out', min_time = '0.29300', max_time = '25.03000', cur_time = '0.366', avg_time = '0.46180512739663', total_polls = '19667', failed_polls = '4', availability = '99.979661361672' where hostname = '80.96.114.3'"
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "select poller_reindex.data_query_id, poller_reindex.action, poller_reindex.op, poller_reindex.assert_value, poller_reindex.arg1 from poller_reindex where poller_reindex.host_id=9"
05/09/2016 02:40:03 PM - PHPSVR: Poller[0] DEBUG: PID[14010] CTR[1] INC: 'ss_fping.php' FUNC: 'ss_fping' PARMS: '80.96.114.3 4 ICMP'
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
--
05/09/2016 02:40:03 PM - PHPSVR: Poller[0] DEBUG: PID[14010] CTR[1] RESPONSE:'min:0.3480 avg:0.3522 max:0.3600 dev:0.0047 loss:0.0000'
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] Host[9] DS[102] SERVER: /var/www/localhost/htdocs/cacti/scripts/ss_fping.php ss_fping 80.96.114.3 4 ICMP , output: min:0.3480 avg:0.3522 max:0.3600 dev:0.0047 loss:0.0000
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (102, '', '2016-05-09 14:40:03', 'min:0.3480 avg:0.3522 max:0.3600 dev:0.0047 loss:0.0000')"
05/09/2016 02:40:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
--
05/09/2016 02:41:03 PM - CMDPHP: Poller[0] Host[9] PING: ICMP Ping Success (0.443 ms)
05/09/2016 02:41:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
05/09/2016 02:41:03 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "update host set status = '3', status_event_count = '0', status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00', status_last_error = 'ICMP ping Timed out', min_time = '0.29300', max_time = '25.03000', cur_time = '0.443', avg_time = '0.46180904342962', total_polls = '19668', failed_polls = '4', availability = '99.97966239577' where hostname = '80.96.114.3'"
05/09/2016 02:41:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
05/09/2016 02:41:03 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "select poller_reindex.data_query_id, poller_reindex.action, poller_reindex.op, poller_reindex.assert_value, poller_reindex.arg1 from poller_reindex where poller_reindex.host_id=9"
05/09/2016 02:41:03 PM - PHPSVR: Poller[0] DEBUG: PID[14215] CTR[1] INC: 'ss_fping.php' FUNC: 'ss_fping' PARMS: '80.96.114.3 4 ICMP'
05/09/2016 02:41:03 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"
--
Cacti - 0.8.7h
Plugin Architecture - 3.0
Poller Type - SPINE 0.8.7g
Server Info - Linux 2.6.35.10 - Slackware 13.1
Web Server - Apache/2.2.17 (Unix) DAV/2 PHP 5.3.5
MySQL - 5.1.53 ;RRDTool - 1.4.5 ;SNMP - 5.6.1
Plugins
  • (tools - v0.3) (Thold - v0.4.6) (Ntop - v0.2) (Discovery - v1.2a) (Monitor - v1.2)
User avatar
dragossto
Cacti User
Posts: 86
Joined: Tue May 15, 2007 5:24 am
Location: Romania
Contact:

Re: Cacti don't update field status_fail_date and status_rec

Post by dragossto »

Solve
each check overwrite the date
because of the line in lib\functions.php :

Code: Select all

$hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00';
$hosts[$host_id]["status_rec_date"] = '0000-00-00 00:00:00';
I apply this modifications :
diff functions.php.org functions.php
673,674c673,675
< $hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00';
< $hosts[$host_id]["status_rec_date"] = '0000-00-00 00:00:00';
---
> if ($hosts[$host_id]["status_fail_date"] == '') { $hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00'; }
> if ($hosts[$host_id]["status_rec_date"] == '') {$hosts[$host_id]["status_rec_date"] = date("Y-m-d H:i:s"); }
> if ($hosts[$host_id]["status_rec_date"] == '0000-00-00 00:00:00') {$hosts[$host_id]["status_rec_date"] = date("Y-m-d H:i:s"); }
864d864
<
The line

Code: Select all

if ($hosts[$host_id]["status_rec_date"] == '0000-00-00 00:00:00') {$hosts[$host_id]["status_rec_date"] = date("Y-m-d H:i:s"); }
will populate all entry , even the host it is Down
Cacti - 0.8.7h
Plugin Architecture - 3.0
Poller Type - SPINE 0.8.7g
Server Info - Linux 2.6.35.10 - Slackware 13.1
Web Server - Apache/2.2.17 (Unix) DAV/2 PHP 5.3.5
MySQL - 5.1.53 ;RRDTool - 1.4.5 ;SNMP - 5.6.1
Plugins
  • (tools - v0.3) (Thold - v0.4.6) (Ntop - v0.2) (Discovery - v1.2a) (Monitor - v1.2)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests