今天一上监控看数据,忽然发现所有服务器都没数据了,先登录到cacti用系统工具中的“重建采集器缓存”也没能恢复。然后赶紧ssh到服务器查看,在mysql数据库的log文件中,看到了报错提示:

154753534.jpg

出现了好几次这样的情况,解决办法如下:

1. 登录mysql数据库

root@shangwubu-jiankong.51mox.com:[/root]mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 34

Server version: 5.1.47 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.


2. 进入数据库

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

3. 修复办法:

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.00 sec)

mysql> select count(*) from poller_output;

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

| count(*) |

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

|        0 |

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

1 row in set (0.00 sec)

mysql> quit

Bye

4. 登录cacti查看实时数据:

155512836.jpg



感谢博文:http://aaaxiang000.blog.163.com/blog/static/2063491220119924923285/