10月 252014
 

复制状态检测插件

[root@monitor libexec]# ./check_mysql_slavestatus.sh -H 192.168.153.113 -P 3306 -u cacti -p qweszxc -w 2 -c 5
 OK: Slave SQL running: Yes Slave IO running: Yes / master: 192.168.153.112 / slave is 0 seconds behind master |
 delay=0s
[root@monitor libexec]#

取值来源

Slave_SQL_Running
Slave_IO_Running
Master_Host
Seconds_Behind_Master

新增插件
http://www.claudiokuenzler.com/nagios-plugins/check_mysql_slavestatus.sh

定义命令

[root@monitor libexec]# vi ../etc/objects/commands.cfg
define command{
 command_name check_mysql_slavestatus
 command_line $USER1$/check_mysql_slavestatus.sh -H $HOSTADDRESS$ -P $ARG1$ -u $ARG2$ -p $ARG3$
 }

在配置文件中引用命令

define service{
 use generic-service
 host_name dbmaster01
 service_description MySQL Slave Status
 check_command check_nrpe!check_mysql_slavestatus!3306!cacti!qweszxc!1!5
 }

优化,重定义(适用多台相同账户配置主机)

# 'check_mysql_slavestatus'
define command{
 command_name check_mysql_slavestatus
 command_line $USER1$/check_mysql_slavestatus.sh -H $HOSTADDRESS$ -P 3306 -u cacti -p qweszxc -w
 $ARG1$ -c $ARG2$
 }
define service{
 use generic-service
 host_name dbmaster01
 service_description MySQL Slave Status
 check_command check_mysql_slavestatus!1!5
 }

nagios-check-mysql-slavestatus

Seconds_Behind_Master 解析

http://blog.itpub.net/23721637/viewspace-1050178/

MySQL slave状态之Seconds_Behind_Master

http://blog.csdn.net/zbszhangbosen/article/details/8494921

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据