藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 系統管理


    

藍森林 http://www.lslnet.com 2006年4月6日 20:18


如何使用net-snmp取到64-bits的數據?

問一個關於net-snmp的問題。

我使用的snmp版本是 "NET-SNMP version: 5.0.6".

想使用snmpwalk命令取網卡64-bits數據,使用
[code]

snmpwalk -c public -v 2c xxx.xxx.xxx.xxx ifHcinoctets

IF-MIB::ifHCInOctets = No Such Object available on this agent at this OID

snmpwalk -c public -v 2c xxx.xxx.xxx.xxx ifHcOutoctets

IF-MIB::ifHCOutOctets = No Such Object available on this agent at this OID

[/code]

發現沒有該OID名字。

使用: [code]
snmpwalk -c public -v 2c X.X.X.X .1.3.6.1.2.1.2.2.1.10
  
iso.3.6.1.2.1.2.2.1.10.1 = Counter32: 410593473
iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 1283622128
iso.3.6.1.2.1.2.2.1.10.3 = Counter32: 3804820006
[/code]

發現沒有Counter64的信息出現。

請問是否有人取過net-snmp的64-bits數據呢?
可以告訴我要怎麼做才能取到嗎?
非常感謝!

thx!
joe

如何使用net-snmp取到64-bits的數據?

up

如何使用net-snmp取到64-bits的數據?

查過了,net-snmp值到5.2的版本才開發出了對應IF-MIB的counter64的補丁,而在最新的版本(5.2.1)中正式支持。
但我裝了5.2.1後還是只看到counter32的東西。 :shock:

如何使用net-snmp取到64-bits的數據?

你還真有心...到處發訊息給我...
給你解答一下:

./configure --prefix=/usr/local       \
--with-sys-contact="abel@localhost"       \
--with-sys-location="Taiwan,Tel:123456767"   \
--with-sysconfdir="/usr/local/etc/snmp" \
--enable-shared  \
--with-default-snmp-version=2 \
--enable-mfd-rewrites
--with-mib-modules=" \
misc/ipfwacc \
mibII \
host \
disman/event-mib \
ucd_snmp agent_mibs \
agentx notification \
target utilities \
ucd-snmp/diskio \
tunnel \
mibII/mta_sendmail "  

snmpd.conf
[code]com2sec lan 211.72.210.0/23 Taiwan
group ROGroup v2c lan
view all included .1
access ROGroup "" any noauth prefix all none none[/code]


[root@log net-snmp]# snmpwalk -v 2c -c TwNic 211.72.211.1 ifHCInoctets
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.1 = Counter64: 526070848
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.2 = Counter64: 1233458245
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.3 = Counter64: 962960073
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.4 = Counter64: 0

以您這種問題的程度,我相信您應是看得懂

如何使用net-snmp取到64-bits的數據?

[quote][i]原帖由 "abel"] net-snmp 發表:[/i]
# snmpwalk -v 2c -c TwNic 211.72.211.1 ifHCInoctets
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.1 = Counter64: 526070848
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifHCInOctets.2 = Counter..........[/quote]

感謝你的回復! :em02:

ps:關鍵的選項應該是「--enable-mfd-rewrites」吧。



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com