ngios流量監控文檔
以下的文檔是在需要被監控的機器上安裝,因為流量需要從被監控機器上抓取。
所需軟件net-snmpnet-snmp-utilsnet-snmp-libs
所需腳本check_traffic.sh可從下面鏈接下載
http://www.itnms.net/discuz/viewthread.php?tid=767&extra=pageD1&page=1
1.查看系統是否安裝rpm–qa|grepsnmp,如沒有上傳以上包,再上傳check_traffic.sh腳本至$nagios/libexec/,并更改traffic腳本權限為755
2.未安裝時下載上面的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來抓取流量,如果要寫成網段,例如: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腳本測試
如果不知道網卡
/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無法得到結果,提示錯誤如下:
OOPS.WegetavaluebiggerthanifSpeedhere.Somethingiswrong.Maybeacheckfrom32bitto64bittransfer,oranyothererrorhere.
解決方法:注釋掉相關語句:
if[$In-gt$ifSpeed-o$Out-gt$ifSpeed];
if[$In-gt$ifSpeed-o$Out-gt$ifSpeed];
就OK了
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。