歡迎您光臨本站 註冊首頁

nagios被監控端nrpe添加流量監控

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0
1.首先下載所需要的nagios被監控端的插件: wget http://mcshell.org/nagios-plugins-1.4.13.tar.gz wget http://mcshell.org/nrpe-2.8.tar.gz wget http://mcshell.org/check_traffic.sh 在這裡感謝http://www.itnms.net/discuz/石頭編寫的腳本. 2.配置snmp 我這裡是用centos 的yum安裝的 yum -y install net-snmp* 修改/etc/snmp/snmp.conf 改為 改為 去掉前面的註釋 改完保存退出 snmp.conf文件在附件中也可以去下載 server snmpd restart 2.安裝nrpe和nagios-plugin 先創建nagios用戶 useradd -m nagios tar zxvf nrpe-2.8.tar.gz
cd nrpe-2.8
./confiugre
make all
make install
make install-daemon-config
make install-daemon
make install-plugin
tar zxvf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure --with-mysql=/usr/local/webserver/mysql
make
make install 3.編輯nrpe.cfg 拷貝check_traffic.sh到/usr/local/nagios/libexec 首先查看能監聽到的網卡 vi /usr/local/nagios/etc/nrpe.cfg 添加 command[check_traffic]=/usr/local/nagios/libexec/check_traffic.sh -V 2c -C nagios -H localhost -I 3 -w 12,30 -c 15,35 -M -b -6
註:-w -c選項為閥值 別忘了添加許可權 chown -R nagios /var/tmp/ 否則監控端無法獲取數據 啟動nrpe /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d 添加啟動項echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local
查看是否埠在監聽,埠是5666 4.監控端的配置 編輯servers.cfg define service {
host_name tc-169.194
use local-service,srv-pnp
service_description traffic
check_period 24x7


max_check_attempts 4
normal_check_interval 1
retry_check_interval 1
contact_groups nagcmd
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_traffic
}
然後重啟nagios 5.驗證效果 由於我添加了pnp插件,有圖像繪製的效果. 下次準備寫一篇關於nagios pnp的文章

本文出自 「mcshell學習博客」 博客,請務必保留此出處http://mcshell.blog.51cto.com/803455/481672


[火星人 ] nagios被監控端nrpe添加流量監控已經有853次圍觀

http://coctec.com/docs/linux/show-post-49306.html