您好,登錄后才能下訂單哦!
nagios 監控slave(check_mysql_health插件)
http://labs.consol.de/wp-content/uploads/2011/08/check_mysql_health-2.1.7.tar.gz
# mount /dev/cdrom /media/cdrom
# rpm -ivh /media/cdrom/Server/perl-DBI-1.52-2.el5.i386.rpm
# rpm -ivh /media/cdrom/Server/perl-DBD-MsSQL-3.0007-2.el5.i386.rpm --nodeps
# tar zxf check_mysql_health-2.1.7.tar.gz
# cd check_mysql_health-2.1.7
# ./configure
# make && make install
# mysql -u root -p123456
> grant all on *.* to ming@'192.168.1.10' identified by '123456';
> quit
下面要借助于nrpe(nrpe安裝步驟略)
# vi /usr/local/nagios/etc/nrpe.cfg
command[slave_io_running]=/usr/local/nagios/libexec/check_mysql_health --hostname 192.168.1.10 --port 3306 --username ming --password 123456 --mode slave-io-running --critical No
command[slave_io_running]=/usr/local/nagios/libexec/check_mysql_health --hostname 192.168.1.10 --port 3306 --username ming --password 123456 --mode slave-sql-running --critical No
:wq
重啟nrpe:
# killall nrpe
# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
# vi /usr/local/nagios/etc/objects/ming.cfg (ming.cfg為監控主機的文件,自建的)
define service{
use local-service ; Name of service template to use
host_name myhostname
service_description slave-io-running
check_command check_nrpe!slave_io_running
}
define service{
use local-service ; Name of service template to use
host_name myhostname
service_description slave-sql-running
check_command check_nrpe!slave_sql_running
}
:wq
重啟nagios
# service nagios restart
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。