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) |