Nagios 利用check_mysql监控mysql主从状态
时间:2014-10-27 14:14 来源:linux.it.net.cn 作者:it
1、增加监控用户
mysql> grant replication client on *.* to 'nagios'@'%'identified by 'nagios';
mysql> flush privileges;
2、登陆从服务器验证是否正常
# mysql -unagios -pnagios -e “show slave stutas\G”
3、监控远程mysql状态
# vim /etc/nagios/nrpe.cfg
添加如下一行:
command[check_mysql_slave]=/usr/lib64/nagios/plugins/check_mysql -P 3306 -u nagios -p nagios -S -w 60 -c 600
在远程主机服务配置文件里面添加如下
define service{
use local-service ; Name of service template to use
host_name mysql
service_description MySQL Slave
check_command check_nrpe!check_mysql_slave
}
4.在监控机运行check_nrpe检查是否可正常
# /usr/lib64/nagios/plugins/check_nrpe -H x.x.x.x -c check_mysql_slave
(责任编辑:IT)
1、增加监控用户 mysql> grant replication client on *.* to 'nagios'@'%'identified by 'nagios'; mysql> flush privileges; 2、登陆从服务器验证是否正常 # mysql -unagios -pnagios -e “show slave stutas\G” 3、监控远程mysql状态 # vim /etc/nagios/nrpe.cfg 添加如下一行: command[check_mysql_slave]=/usr/lib64/nagios/plugins/check_mysql -P 3306 -u nagios -p nagios -S -w 60 -c 600 在远程主机服务配置文件里面添加如下
define service{ 4.在监控机运行check_nrpe检查是否可正常 # /usr/lib64/nagios/plugins/check_nrpe -H x.x.x.x -c check_mysql_slave (责任编辑:IT) |