天天看点

cacti监控mysql

安装rrtools

yum localinstall rrdt* --nogpgcheck

拆解 cacti的数据包

将cacti 搬移致/var/www/html

配置mysql

CREATE DATABASE cacti;

//若只监控本机,这句就够了

#grant all privileges on cacti.* to [email protected] identified by 'cacti';

//否则,要在那台服务器上的mysql中授权允许cacti主机的连接

实验过程中,很多人出现graps下为空表,或无表,大多是因为这里未正确授权,导致无法连接到数据库造成的,可以用以下命令测试是否可以正常连接

mysql -h 192.168.0.1 -ucacti -pcacti

cacti 网页默认登陆密码:admin admin

无法登陆:

cacti监控mysql
cacti监控mysql

################################

创建账号

useradd cacti -p cacti

改变权限

cd /var/www/html/cacti/

chown -R cacti rra log

配置snmp

编辑 crontab -e //每5分钟采集一次数据

导入数据库

编辑cacti的配置脚本

vim /var/www/html/cacti/include/config.php

cacti监控mysql

http://cacti地址/cacti

cacti监控mysql
cacti监控mysql

安装插件管理器

到控制台中启用插件 Utilities下 User Management > admin >Realm Permissions >Plugin Management >save

cacti监控mysql

Configureation下 Plugin Management >Actions 下Install Plugin(蓝色向下的箭头) >Enable Plugin(绿色向右的箭头)

cacti监控mysql

监控mysql

修改脚本文件

导入模版

Import Templates >浏览> templates/cacti_host_template_x_mysql_server_ht_0.8.6i-sver1.1.8.xml>Import

cacti监控mysql
cacti监控mysql

Devices 》add》 》Create Graphs for this Host

cacti监控mysql

##################################################

email

settings>mail/dns >send a test mail

cacti监控mysql

告警邮件:

cacti监控mysql

Down机邮件

cacti监控mysql
cacti监控mysql

msn通知(昨天的聊天记录):

cacti监控mysql

短信报警:

cacti监控mysql