您好,登錄后才能下訂單哦!
nagios 的編譯安裝
yum install httpd php gcc glibc glibc-common gd gd-devel openssl openssl-devel -y
ubuntu 安裝openssl-devel 是
apt-get 無法安裝 openssl-devel請執行: sudo apt-get install openssl apache2 php gcc glibc glibc-common gb gd-devel
sudo apt-get install libssl-dev
/usr/sbin/useradd -M -s /sbin/nologin nagios
mkdir -p /opt/nagios_install_packages
cd /opt/nagios_install_packages
wget http://softlayer-dal.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.1/nagios-4.0.1.tar.gz
wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz
# nagios
tar -xf nagios-4.0.1.tar.gz
cd nagios-4.0.1
./configure --prefix=/usr/local/nagios
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
htpasswd -c -m /usr/local/nagios/etc/htpasswd nagios
service httpd restart
cd /opt
# plugins
tar -xf nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure --prefix=/usr/local/nagios/
make
make install
chkconfig --add nagios
chkconfig nagios on
service nagios start
-------------------------------------------------------------------
nrpe 的編譯安裝
#nrpe 的下載http://sourceforge.net/projects/nagios/files/nrpe-2.x/
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz/download?use_mirror=hivelocity&r=&use_mirror=hivelocity
nrpe 在被監控服務端的安裝
服務器監控:nrpe監控客戶端安裝
注:安裝過程需要有root用戶權限,關閉主機防火墻(或者開放5666端口)。
所需軟件包:nagios-plugins-1.5.tar.gz
nrpe-2.15.tar.gz
安裝環境說明:
nagios監控端IP:192.168.0.10
nrpe監控客戶端IP:192.168.0.20
1、添加nagios用戶
useradd nagios -s /sbin/nologin -M
注意:在ubuntu 中這樣添加用戶 useradd nagios -M -s /usr/sbin/nologin
2、安裝過程
安裝nrpe
tar zxvf nrpe-2.15.tar.gz
cd nrpe-2.15
./configure --prefix=/usr/local/nrpe --enable-command-args
#make all
#make install-plugin
#make install-daemon
#make install-daemon-config
***以上安裝完成后會在/usr/local/nrpe目錄下產生bin、etc、libexec三個目錄***
注意在ubuntu 下:
./configure --prefix=/usr/local/nrpe --enable-command-args --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
安裝nagios插件
tar zxvf nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure --prefix=/usr/local/nrpe
make && make install
***以上安裝完成后會在/usr/local/nrpe目錄下產生libexec、share兩個目錄***
3、修改nrpe.cfg配置文件
allowed_hosts=127.0.0.1, 192.168.0.10
dont_blame_nrpe=1
定義命令,如:
command[check_tcp]=/usr/local/nrpe/libexec/check_tcp -p $ARG1$ -w $ARG2$ -c $ARG3$
4、修改目錄/文件權限
chown -R nagios.nagios /usr/local/nrpe
5、啟動nrpe守護進程
/usr/local/nrpe/bin/nrpe -c /usr/local/nrpe/etc/nrpe.cfg -d
6、nagios監控端測試nrpe是否安裝成功
/usr/local/nagios/libexec/check_nrpe -H 192.168.0.20
如果返回“NRPE v2.15”即為已安裝成功并啟動
-------------------------------------------------------------------------
nrpe 在nagios 服務器器端的安裝
tar zxvf nrpe-2.5.tar.gz
cd nrpe-2.5
./configure
make && make install-plugin
/usr/local/nagios/libexec/check_nrpe -H 被監控主機的IP
NRPE V.2.5
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。