cacti因爲系統時間不對而不出圖的解決方法

這個問題是因爲時間問題引發的!php

查看cacti的日誌就能夠看出來:html

Log File [Total Lines: 14 - All Items Shown]mysql

05/18/2012 09:50:49 AM - AUTH LOGIN: User 'admin' Authenticatedsql

05/18/2012 09:50:16 AM - MANAGE: Poller[0] Checking Manage數據庫

05/18/2012 09:50:06 AM - SYSTEM SYSLOG STATS:Time:0.28 Deletes:0 Incoming:0 Removes:0 XFers:39 Alerts:0 Alarms:0 Reports:0服務器

05/18/2012 09:50:06 AM - SYSTEM THOLD STATS: Time:0.0172 Tholds:0 DownHosts:0ide

05/18/2012 09:50:06 AM - SYSTEM STATS: Time:-28796.2396 Method:spine Processes:1 Threads:1 Hosts:2 HostsPerProcess:2 DataSources:15 RRDsProcessed:15日誌

05/18/2012 05:45:16 PM - MANAGE: Poller[0] Checking Managehtm

05/18/2012 05:45:10 PM - RECACHE STATS: RecacheTime:4.3342 HostsRecached:1進程

05/18/2012 05:45:06 PM - SYSTEM SYSLOG STATS:Time:0.55 Deletes:0 Incoming:0 Removes:0 XFers:30 Alerts:0 Alarms:0 Reports:0

05/18/2012 05:45:06 PM - PCOMMAND: Poller[0] Host[1] WARNING: Recache Event Detected for Host

05/18/2012 05:45:05 PM - SYSTEM THOLD STATS: Time:0.0343 Tholds:0 DownHosts:0

05/18/2012 05:45:05 PM - SYSTEM STATS: Time:2.6126 Method:spine Processes:1 Threads:1 Hosts:2 HostsPerProcess:2 DataSources:15 RRDsProcessed:15

05/18/2012 05:45:02 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 1296601 seconds have passed since the last poll!

05/03/2012 05:35:16 PM - MANAGE: Poller[0] Checking Manage

05/03/2012 05:35:10 PM - WEBUI: Cacti Log Cleared from Web Management Interface 

能夠看出剛開始時間是下午5:45,最後又變成早上9:50,時間是先超前最後又變成正確的了(這是因爲系統每過10分鐘會和時間服務器同步一次時間)。

這樣會致使數據庫記錄poller的執行時間出問題:

mysql> select * from poller_time

    -> ;

+----+------+-----------+---------------------+---------------------+

| id | pid  | poller_id | start_time          | end_time            |

+----+------+-----------+---------------------+---------------------+

|  1 | 2231 |         0 | 2012-05-18 17:50:03 | 2012-05-18 09:50:05 |

+----+------+-----------+---------------------+---------------------+

1 row in set (0.00 sec)

mysql> 

能夠看出poller的執行結束時間end_time比開始時間start_time更早,這樣會致使poller進程中止工做,直到系統時間超過了start_time,poller進程纔回開始工做,圖像才能出來!這裏要特別說明下:不能簡單地修改數據庫poller_time表裏的時間,由於數據庫裏面還有好多表也記錄了採集各類數據的時間。

因此解決辦法有兩個:

1 等系統時間超過start_time(過了下午5點50),一切恢復正常(若是你有耐心 )。

2 若是如今系統的時間不正確先把系統時間修改正確,而後刪除/var/www/html/rra/下面的全部文件,最後強制執行poller程序從新生成/var/www/html/rra/下面的全部文件。操做過程以下:

[root@Yunweiw ~]# rm -rf /var/www/html/rra/*

[root@Yunweiw ~]# /usr/bin/php /var/www/html/poller.php --force

Manage : initializing...

Checking Manage... TCP : 

      Data Source : 9 is : 1

Checking Manage... TCP : 

      Data Source : 8 is : 1

OK u:0.00 s:0.01 r:1.87

OK u:0.00 s:0.01 r:1.87

OK u:0.00 s:0.02 r:1.88

OK u:0.00 s:0.02 r:1.88

OK u:0.00 s:0.02 r:1.90

OK u:0.00 s:0.02 r:1.90

OK u:0.00 s:0.02 r:1.91

OK u:0.00 s:0.02 r:1.91

OK u:0.00 s:0.02 r:1.92

OK u:0.00 s:0.02 r:1.92

OK u:0.00 s:0.02 r:1.93

OK u:0.00 s:0.02 r:1.93

OK u:0.00 s:0.02 r:1.95

OK u:0.00 s:0.02 r:1.95

OK u:0.00 s:0.02 r:1.96

OK u:0.00 s:0.02 r:1.96

OK u:0.00 s:0.02 r:1.97

OK u:0.00 s:0.02 r:1.97

OK u:0.00 s:0.02 r:1.98

OK u:0.00 s:0.02 r:1.98

OK u:0.00 s:0.02 r:1.99

OK u:0.00 s:0.02 r:1.99

OK u:0.00 s:0.03 r:2.00

OK u:0.00 s:0.03 r:2.01

OK u:0.00 s:0.03 r:2.02

OK u:0.00 s:0.03 r:2.02

OK u:0.00 s:0.03 r:2.03

OK u:0.00 s:0.03 r:2.03

OK u:0.00 s:0.03 r:2.05

OK u:0.00 s:0.03 r:2.05

05/18/2012 11:38:00 AM - SYSTEM STATS: Time:2.2115 Method:spine Processes:1 Threads:1 Hosts:2 HostsPerProcess:2 DataSources:15 RRDsProcessed:15

[root@Yunweiw ~]# 

注意必定要先刪除/var/www/html/rra/下的全部文件在執行/usr/bin/php /var/www/html/poller.php --force,否則有些rra會報時間錯誤!

等一會久違的圖像就出來啦..

相關文章
相關標籤/搜索