您好,登錄后才能下訂單哦!
#!/bin/bash
/etc/init.d/iptables stop
setenforce 0
rm -rf /usr/local/nagios/*
echo "=========================下載nrpe"
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz
echo "=========================下載nagios插件"
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
echo "安裝nagios插件開始..................."
/usr/sbin/useradd nagios
tar zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --prefix=/usr/local/nagios && make && make install
chown -R nagios.nagios /usr/local/nagios
if [ "$?" -eq "0" ] ;then
echo "安裝nagios插件完成.................."
else echo "安裝nagios插件失敗............."
fi
sleep 5
cd ..
echo "安裝nrpe開始........................."
tar zxvf nrpe-2.13.tar.gz
cd nrpe-2.13
./configure && make all && make install-plugin && make install-daemon && make install-daemon-config
if [ "$?" -eq "0" ] ;then
echo "安裝nrpe完成.................."
else echo "安裝nrpe失敗............."
fi
rm -rf nagios-plugins-1.4.16* nrpe-2.13*
此處根據(jù)實際情況修改nagios服務(wù)器IP
sed -i '/allowed_hosts/s/127.0.0.1/192.168.100.41/' /usr/local/nagios/etc/nrpe.cfg
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
netstat -nptl |grep 5666
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。