bco 发表于 2019-1-10 09:04:09

Cacti安装后不出图解决方法

  Cacti安装后不出图解决方法
  这个问题是由于时间问题引起的!
  查看cacti的日志就可以看出来:
  Log File
  05/18/2012 09:50:49 AM - AUTH LOGIN: User 'admin' Authenticated
  05/18/2012 09:50:16 AM - MANAGE: Poller 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:0
  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 Checking Manage
  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 Host 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 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 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
  -> ;
  +----+------+-----------+---------------------+---------------------+

  |>  +----+------+-----------+---------------------+---------------------+
  |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/下面的所有文件。操作过程如下:
  # rm -rf /var/www/html/rra/*
  # /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
  #
  注意一定要先删除/var/www/html/rra/下的所有文件在执行/usr/bin/php /var/www/html/poller.php --force,不然有些rra会报时间错误!
  刷新下界面就好了

页: [1]
查看完整版本: Cacti安装后不出图解决方法