溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

nagios 監(jiān)控mysql

發(fā)布時(shí)間:2020-04-09 00:51:27 來(lái)源:網(wǎng)絡(luò) 閱讀:713 作者:yang12313 欄目:移動(dòng)開發(fā)

安裝nrpe-2.13.tar.gz   nagios-plugins-1.4.15.tar.gz
vim commands.cfg
加入:
#vim'check_mysql'  command definition

define command {      

command_name    check_mysql    

command_line  $USER1$/check_mysql  -H $HOSTADDRESS$  -u nagios  -d nagios 

vim  localhost.cfg (沒(méi)有采用自定配置文件service.cgf這類的。我的是本機(jī)監(jiān)控)
加入
define service{       

use          local-service    ;Name of service template to  use        host_name    192.168.1.204       

service_description    MYSQL       

check_command     check_mysql       

notifications_enabled    0

(或者check_nrpe!check_mysql 這個(gè)根據(jù)自己來(lái),我本機(jī)上加上了check_nrpe就不能運(yùn)行{看到有文章用 check_nrpe!check_mysql })

nrpe.cnf配置 pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,192.168.1.204
dont_blame_nrpe=0
debug=0
command_timeout=60
connection_timeout=300
command[check_mysql]=/usr/local/nagios/libexec/check_mysql  -m connection-time -u xxxx -p xxxxxx  -P 3306  -H 192.168.1.204(在本地不需要添加-H選項(xiàng))
停止nrpe  ps -ef | grep  nrpe        kill (-9)  pid啟動(dòng)nrpe: /usr/local/nagios/libexec/bin/nrpe  -c /usr/local/nagios/etc/nrpe.cfg -d

重啟nagios  service  nagios  restart

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI