您好,登錄后才能下訂單哦!
1、下載nrpe2.15
wget http://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配置文件,增加監控機地址:
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
設置開機啟動
vi /etc/rc.d/rc.local加入/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
驗證是否啟動
netstat -an |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
7、報錯
1)NRPE: Command 'check_hda1' not defined
解決方法:
nagios主機與被監控linux同時修改: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為需要監控的分區
2)NRPE: Command 'check_swap' not defined
解決方法:
nagios主機與被監控linux同時修改:vi /usr/local/nagios/etc/nrpe.cfg
增加command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
8、參考內容http://chenxy.blog.51cto.com/729966/175893/
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。