icinga2 check_mysql_health插件


https://labs.consol.de/nagios/check_mysql_health/


# tar zxfv check_mysql_health-2.2.2.tar.gz

# cd check_mysql_health-2.2.2

# ./configure

# make

# make install

# cp -rv /usr/local/nagios/libexec/check_mysql_health /usr/lib64/nagios/plugins/

# chmod +x /usr/lib64/nagios/plugins/check_mysql_health


编译生成的check_mysql_health可以直接给其它服务器用,不需要再编译生成


抓取mysql连接数:


# /usr/lib64/nagios/plugins/check_mysql_health --hostname 127.0.0.1 --username iccheck --password xxxxxx --mode threads-connected --warning 1000 --critical 2000


写到/etc/nagios/nrpe.cfg


# vi /etc/nagios/nrpe.cfg


command[check_mysql_C]=sudo  /usr/lib64/nagios/plugins/check_mysql_health --hostname 127.0.0.1 --username iccheck --password xxxxx --mode threads-connected --warning 1000 --critical 2000


:wq



# service nrpe restart  (Ubuntu是service nagios-npre-server restart)



icinga2配置略