您好,登錄后才能下訂單哦!
1.nagios 啟動(dòng)(root身份)
/etc/init.d/nagios restart
(/etc/init.d/xinetd restart 重啟nsca,用于接收客戶端的數(shù)據(jù),端口為5667,接收數(shù)據(jù)出現(xiàn)問題時(shí),需要重啟)
2.nagios 配置文件編輯
(su - nagios編輯)
1)/usr/local/nagios/etc/objects/hostgroups.cfg中定義hostgroup,有時(shí)禁用host,需要在這里把相應(yīng)主機(jī)注釋掉
define hostgroup{
hostgroup_name NETWORK-DEVICE Group
alias NETWOKR_DEVICE
members FW01
}
2)/usr/local/nagios/etc/nagios.cfg (禁用主機(jī)注釋掉相應(yīng)主機(jī)配置文件)
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
服務(wù)端
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
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。