Cacti 硬盘空间满,无法运行解决方法 下载本文

内容发布更新时间 : 2024/5/2 6:41:14星期一 下面是文章的全部内容请认真阅读。

昨天CactiEZ服务器突然无法正常运行了,系统提示磁盘空间已满,MySQL服务不能启动。经检查发现虚拟机只分配了8G的空间容量,而Cacti每天会自动备份/var/www/html,因此空间很快被占满了。

手动清除备份文件后,系统运行正常,但是Cacti无法抓取信息了,图片一直没有数据更新。查看Cacti log发现很错类似的错误提示:

04/02/2010 01:17:56 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'2006', SQL:\

04/02/2010 01:17:55 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'2006', SQL:\poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from

(poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 10000\登入系统,在MySQL下执行上述语句 [root@localhost ~]# mysql -uroot

Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 1220 Server version: 5.0.68 Source distribution

Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer. mysql> use cacti

Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed

mysql> select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from

(poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name);

ERROR 145 (HY000): Table './cacti/poller_output' is marked as crashed and should be repaired mysql> exit Bye

可以看到是 /var/lib/mysql/cacti/poller_output 这个文件有问题,我们需要修复一下。 [root@localhost ~]# myisamchk --safe-recover --force /var/lib/mysql/cacti/poller_output Warning: option 'key_buffer_size': unsigned value 18446744073709551615 adjusted to

4294963200

Warning: option 'read_buffer_size': unsigned value 18446744073709551615 adjusted to 4294967295

Warning: option 'write_buffer_size': unsigned value 18446744073709551615 adjusted to 4294967295

Warning: option 'sort_buffer_size': unsigned value 18446744073709551615 adjusted to 4294967295

- recovering (with keycache) MyISAM-table '/var/lib/mysql/cacti/poller_output' Data records: 81

之后重启MySQL服务就可以啦。 [root@localhost ~]# service mysqld restart

Stopping MySQL: [ OK ] Starting MySQL: [ OK ]

Cacti 不出图修复

1、CACTI 不画图 类似报错 Poller[0] ERROR: SQL Assoc Failed!, Error:'1017' If you can not fix the error with poller_output table not show: Just run mysql, use database \+ mySQL>select count(*) from poller_output; If too much data, run query:

+ mysql> truncate table poller_output; And it worked for my issue. Good luck, Manh Dung 具体命令

[root@70yx_lan_monitor ~]# mysql

Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 97

Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. mysql> use \

Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed

mysql> select count(*) from poller_output;

ERROR 145 (HY000): Table './cacti/poller_output' is marked as crashed and should be repaired

mysql> truncate table poller_output; Query OK, 0 rows affected (0.02 sec) mysql> select count(*) from poller_output; +----------+ | count(*) | +----------+ | 0 | +----------+

1 row in set (0.00 sec)

2、2 常见不出图或有图无数据解决办法之一:登录CactiEZ中文版V10,点击“工具”菜单中的“系统工具”,然后点击“重建采集器缓存”。几分钟之后再查看是否正常,该办法能解决大多数问题。