1、下載nrpe2.15
泰寧ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
wgethttp://cznic.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
2、yum install openssl openssl-devel
cd nrpe-2.15
./configure --enable-ssl --with-nagios-user=nagios --with-nagios-group=nagcmd --with-nrpe-user=nagios --with-nrpe-group=nagcmd
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
3、編輯nrpe配置文件,增加監(jiān)控機(jī)地址:
vi /etc/xinetd.d/nrpe
only_from = nagios-server-ip,127.0.0.1
4、編輯vi /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=nagios-server-ip,127.0.0.1
5、修改services文件,增加端口
vi /etc/services
nrpe 5666/tcp #NRPE
6、啟動 nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
設(shè)置開機(jī)啟動
vi /etc/rc.d/rc.local加入/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
驗(yàn)證是否啟動
netstat -an |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
7、報(bào)錯(cuò)
1)NRPE: Command 'check_hda1' not defined
解決方法:
nagios主機(jī)與被監(jiān)控linux同時(shí)修改:vi /usr/local/nagios/etc/nrpe.cfg
將command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
修改為 command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
注意 sda1為需要監(jiān)控的分區(qū)
2)NRPE: Command 'check_swap' not defined
解決方法:
nagios主機(jī)與被監(jiān)控linux同時(shí)修改:vi /usr/local/nagios/etc/nrpe.cfg
增加command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
8、參考內(nèi)容http://chenxy.blog.51cto.com/729966/175893/