您好,登錄后才能下訂單哦!
1.nagios 啟動(root身份)
/etc/init.d/nagios restart
(/etc/init.d/xinetd restart 重啟nsca,用于接收客戶端的數據,端口為5667,接收數據出現問題時,需要重啟)
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 用來檢查配置是否有問題,
出現這樣的說明沒問題
.........
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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。