您好,登錄后才能下訂單哦!
ngios流量監(jiān)控文檔
以下的文檔是在需要被監(jiān)控的機(jī)器上安裝,因?yàn)榱髁啃枰獜谋槐O(jiān)控機(jī)器上抓取。
所需軟件net-snmpnet-snmp-utilsnet-snmp-libs
所需腳本check_traffic.sh可從下面鏈接下載
http://www.itnms.net/discuz/viewthread.php?tid=767&extra=pageD1&page=1
1.查看系統(tǒng)是否安裝rpm–qa|grepsnmp,如沒有上傳以上包,再上傳check_traffic.sh腳本至$nagios/libexec/,并更改traffic腳本權(quán)限為755
2.未安裝時(shí)下載上面的snmp的rpm包我用的為
net-snmp-5.1.2-13.el4.i386net-snmp-utils-5.1.2-13.el4.i386net-snmp-libs-5.1.2-13.el4
3.vi/etc/snmp/snmp.conf
a)更改
#sec.namesourcecommunity
com2secnotConfigUserdefaultpublic
為
#sec.namesourcecommunity
com2secnotConfigUserlocalhost(源IP)nagios(訪問密碼)
注:上面提到的源IP,指的是允許哪些IP來抓取流量,如果要寫成網(wǎng)段,例如:192.168.0.0/24。代表允許192.168.0.0/24
b)更改
accessnotConfigGroup""anynoauthexactsystemviewnonenone
為
accessnotConfigGroup""anynoauthexactmib2nonenone
c)去掉該的#
#viewmib2included.iso.org.dod.internet.mgmt.mib-2fc
d)啟動snmp
/etc/init.d/snmpdstart
檢查啟動情況
Netstat–na|grep161
測試snmpsnmpwalk-v1-cnagioslocalhostsystem
Traffic腳本測試
如果不知道網(wǎng)卡
/usr/local/nagios/libexec//check_traffic.sh-V2c-Cnagios-Hlocalhost–L命令列出
/usr/local/nagios/libexec//check_traffic.sh-V2c-Cnagios-Hlocalhost-I2-w12,30-c15,35-M–b
用原始的check_traffic.sh無法得到結(jié)果,提示錯(cuò)誤如下:
OOPS.WegetavaluebiggerthanifSpeedhere.Somethingiswrong.Maybeacheckfrom32bitto64bittransfer,oranyothererrorhere.
解決方法:注釋掉相關(guān)語句:
if[$In-gt$ifSpeed-o$Out-gt$ifSpeed];
if[$In-gt$ifSpeed-o$Out-gt$ifSpeed];
就OK了
免責(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)容。