1.nagios 啟動(root身份)
慈利ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)建站的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!
/etc/init.d/nagios restart
(/etc/init.d/xinetd restart 重啟nsca,用于接收客戶端的數(shù)據(jù),端口為5667,接收數(shù)據(jù)出現(xiàn)問題時,需要重啟)
2.nagios 配置文件編輯
(su - nagios編輯)
1)/usr/local/nagios/etc/objects/hostgroups.cfg中定義hostgroup,有時禁用host,需要在這里把相應主機注釋掉
define hostgroup{
hostgroup_name NETWORK-DEVICE Group
alias NETWOKR_DEVICE
members FW01
}
2)/usr/local/nagios/etc/nagios.cfg (禁用主機注釋掉相應主機配置文件)
cfg_file=/usr/local/nagios/etc/objects/DB1.cfg
3.檢查配置,
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg用來檢查配置是否有問題,
出現(xiàn)這樣的說明沒問題
.........
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
再用root重啟/etc/init.d/nagios restart
常用腳本
客戶端
useradd -u 2001 -s /sbin/nologin nagios
cd /usr/local
tar -xzvf nagios.tar.gz
sed -i "s/WEB2/DB3/g" /usr/local/nagios/exe_scripts.sh
echo "*/2 * * * * sh /usr/local/nagios/exe_scripts.sh >/dev/null 2>&1" >>/var/spool/cron/nagios
服務端
sed -i "s/ DB1/DB3/g" /usr/local/nagios/etc/objects/DB3.cfg
sed -i "s/address 10.99.2.40/address 10.99.2.42/g" /usr/local/nagios/etc/objects/DB3.cfg