1.给数据库添加一个用于监控的账户
grant super,replication slave on *.* to 'check'@'%' identified by '123456';
flush privileges;
2.测试
cd /usr/local/nagios/libexec
./check_mysql -u check -p '123456' -P3306 -H 10.10.0.14
3.编辑nrpe.cfg,添加如下内容
command[check_slave]=/usr/local/nagios/libexec/check_mysql -u check -p '123456' -P3306 -H 127.0.0.1 -S
4.重起nrpe:
pkill nrpe && /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d && ps -ef|grep nrpe
5.服务端添加服务
define service {
use generic-service
host_name MySQL2
service_description MySQL3306-Slave
check_command check_nrpe!check_slave
}
停留在世界边缘,与之惜别