灌溉梦想,记录脚步
标签类目:cacti

Cacti和Nagios因目录占满引起的问题

进行系统 “df -lh” 发现根分区100%。伴随cacti无图像,nagios无数据。

检查数据库日志发现很多:
[ERROR] /usr/libexec/mysqld: Table ‘./xxx’ is marked as crashed and should be repaired

检查Cacti日志发现很多,文件增长迅速:
CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:’1017′,

先修复mysql文件:
myisamchk -c -r /var/lib/mysql/cacti/host_snmp_cache.MYI
myisamchk -c -r /var/lib/mysql/nagios/nagios_logentries.MYI

针对cacti日志出现表查询报错进行修复:
mysql> truncate table poller_output;

之后查询Cacti日志发现如下报错:
CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:’2006′

进行cacti控制台,点击“Console-System Utilities-Rebuild Poller Cache” 重建缓存。

Cacti和Nagios恢复正常。

用cacti监控memcached状态

cacti 配置步骤略

1,安装python环境

1
yum install python python-setuptools -y

2,安装python-memcached

1
2
3
4
wget ftp://ftp.tummy.com/pub/python-memcached/python-memcached-1.45.tar.gz
tar xzvf python-memcached-1.45.tar.gz
cd python-memcached-1.45
python setup.py install

继续阅读 »

linux/centos cacti备份及恢复shell

备份及恢复Cacti
(1)cacti的文件目录的备份(rra目录除外)
(2)mysql备份
mysqldump -p cacti >/tmp/cacti.sql
(3)备份rra
dumprrd.sh

#!/bin/sh
rrddump=”/usr/local/bin/rrdtool dump”
xmldir=”/tmp/mysqlbackup/rraxml”
xmlbackup=”/tmp/mysqlbackup/rrabak”
mysqlbackupDIR=”/tmp/mysqlbackup”
rrdpath=”/usr/local/share/cacti/rra/”
DATE=`date +”%y-%m-%d”`
if [ ! -e {xmldir}
继续阅读 »