您好,登錄后才能下訂單哦!
一,安裝所需軟件net-snmp net-snmp-utils net-snmp-libs net-snmp-devel
yum install net-snmp net-snmp-utils net-snmp-libs net-snmp-devel
二,修復(fù)snmp配置:
vim /etc/snmp/snmp.conf 修改為:
# sec.name source community
#com2sec notConfigUser default public
com2sec notConfigUser localhost public
access notConfigGroup "" any noauth exact mib2 none none
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
三,啟動(dòng)snmp服務(wù):
service snmpd start
四,設(shè)置開啟啟動(dòng):
chkconfig snmpd on
五,上傳插件到/usr/local/nagios/libexec (插件在附件中)
六,配置
測(cè)試check_traffic 腳本:
cd /usr/local/nagios/libexec
./check_traffic -V 2c -C nagios -H localhost –L命令列出網(wǎng)絡(luò)接口
cd /usr/local/nagios/etc
vim nrpe.cfg #添加
command[check_traffic]=/usr/local/nagios/libexec/check_traffic -V 2c -C public -H localhost -I 2 -w 2200,4000 -c 2500,4500 -K -B
-I 2 指網(wǎng)卡接口(就是你要監(jiān)控的網(wǎng)卡接口)
修改chown nagios:nagios /var/tmp/check_traffic_localhost_2.hist_dat
重啟nrpe 服務(wù)
七,配置監(jiān)控服務(wù)器:
cd /usr/local/nagios/etc/objects
編輯vim services.cfg中添加:
define service {
use services-pnp
host_name xxx-Server
service_description check-traffic
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_traffic
}
八,測(cè)試
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。