歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

VMware Linux下Nagios監控遠程主機的簡單設置

測試的主機為兩台虛擬機
vm linux1:192.168.1.122 //作為監控主機
vmlinux2:192.168.1.192 //作為被監控的主機
首先是被監控主機的設置
相關閱讀:
VMware Linux下Nagios的安裝 http://www.linuxidc.com/Linux/2011-11/47908.htm
VMware Linux下Nagios的基本配置 http://www.linuxidc.com/Linux/2011-11/47909.htm
VMware Linux下Nagios和PNP的整合 http://www.linuxidc.com/Linux/2011-11/47910.htm
[root@localhost ~]# ls nagios-plugins-1.4.15.tar.gz //安裝nagios的套件
nagios-plugins-1.4.15.tar.gz
[root@localhost ~]# tar zxvf nagios-plugins-1.4.15.tar.gz
[root@localhost nagios-plugins-1.4.15]# useradd -s /sbin/nologin nagios
[root@localhost nagios-plugins-1.4.15]# ./configure
[root@localhost nagios-plugins-1.4.15]# make;make install
[root@localhost nagios-plugins-1.4.15]# cd /usr/local/
[root@localhost local]# chown nagios:nagios nagios/
[root@localhost local]# chown nagios:nagios -R nagios/libexec/
[root@localhost ~]# ls nrpe-2.8b1.tar.gz //這裡就是安裝配置nrpe的部分
nrpe-2.8b1.tar.gz
[root@localhost ~]# tar zxvf nrpe-2.8b1.tar.gz
[root@localhost ~]# cd nrpe-2.8b1
[root@localhost nrpe-2.8b1]# ./configure
[root@localhost nrpe-2.8b1]# make all
[root@localhost nrpe-2.8b1]# make install-plugin
[root@localhost nrpe-2.8b1]# make install-daemon
[root@localhost nrpe-2.8b1]# make install-daemon-config
當然啦,你如果英語不錯的話,直接參考分包內的說明安裝(以下)
[root@localhost nrpe-2.8b1]# ll NRPE.pdf
-rw-rw-r-- 1 nagios nagios 212236 Mar 14 2007 NRPE.pdf
[root@localhost ~]# cd /usr/local/nagios/etc/
[root@localhost etc]# vi nrpe.cfg //修改主配置檔
server_address=192.168.1.192 //被監控主機ip
allowed_hosts=127.0.0.1,192.168.1.122,192.168.1.192 //這裡是監控主機的設置,為了檢測使用,本機的ip也加上
[root@localhost etc]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d //啟動nrpe這個守護進程
[root@localhost etc]# netstat -tulnp|grep 5666
tcp 0 0 192.168.1.192:5666 0.0.0.0:* LISTEN 3384/nrpe
[root@localhost etc]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.192 //nrpe是否正常工作時的檢測
NRPE v2.8b1
Copyright © Linux教程網 All Rights Reserved