문제

Which method is best to iterate keys in a snmpwalk? I need to find statistics for network in different boards in different PCs. Linux and Windows. I understand that the 1.3.1..... is different. How can I do something like "snmp fetch eth0 mrtu value" ? or "snmp fetch dsk "D" free%" ?

Should I open every mib under mibs directory and trackdown every meaningfull or meaningless key that is "dsk" or "net" and give it a try? And what value suits for me, keep it aside?

Or is there a 'rightful' method ? I need to make a code working on java but yet I don't possess the knowledge yet.

도움이 되었습니까?

해결책

Under MIBII you've got standard MIBs in which you can find useful informations about Disk an Interfaces. You can study these MIBS and write the code that get back just the necessaries counters. I think that it could be a bit different from Windows to Linux but not so. A "snmp fetch eth0 mrtu value" has sense if you are sure eth0 exists on the remote computer, so you'd better discover things and then poll them.

Remember that :

A SnmpWalk (as pointed by @bstPierre) is no more than multiple SNMP-GETNEXT/SNMP-RESPONSE so it as a cost on the bandwith, and the result is not so easy to compute.

With a simple SNMP-GET/SNMP-RESPONSE you can retreive multiple counters.

다른 팁

To walk the MIB, use the SNMP GETNEXT operation. Do it repeatedly to perform a MIB walk.

See this example for snmp4j.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top