# tar zxvf check_mysql_health-2.1.1.tar.gz
# ./configure \
–prefix=/usr/local/nagios/ \
–with-nagios-user=nagios \
–with-nagios-group=nagios \
–with-perl=/usr/bin/perl \
–with-statefiles-dir=/usr/local/nagios/var/tmp \
–with-perl=/usr/bin/perl
# make
# make install
— check_mysql_health监控配置
定义commands.cfg
#'check_mysql_health' command
definition
define command{
command_name
check_mysql_health
command_line
$USER1$/check_mysql_health --hostname $ARG1$ --username $ARG2$
--password $ARG3$ --mode $ARG4$ --warning $AR
G5$ --critical $ARG6$
}
–查看当前连接到数据库的连接数:
[root@localhost mysql]#
/usr/local/nagios/libexec/check_mysql_health --hostname IP --port
3306 --username "USER" --password