SNMP GetBulk command
i wo开发者_如何学JAVAuld like to know whether i can use the getbulk command with SNMPv1. If yes please let me know its adv... in no then what are the drawbacks.
Thanks in advance.
Uday.
No. That is determined by the protocol stack (GET BULK was introduced in v2 stack), not by other factors.
If you want to use GET BULK, you have to use SNMP v2 and v3, not v1.
As others have stated, the GetBulkRequest was introduced in SNMPv2. However you may find it useful to know that a version 1 GetRequest PDU can be associated with multiple variable bindings. In doing so, the GetRequest response will contain a mapping of those OID objects and their current values (if the request was successful).
If you do not require the "walking" of the tree, and you have all the OID's in advance, then loading a GetRequest with all needed variable bindings may work for you.
If you are using Java, the SNMP4J API is compatible with SNMP v1, v2c and v3. SNMP4J API
It's worth noting that GETBULK is in v2c, which is a minor upgrade to SNMPv1 and thus supported by nearly every device these days even if the vendor didn't go to the trouble of doing SNMPv3 entirely.
SNMPv1: uses communities with V1 PDUs SNMPv2c: uses communities with V2 PDUs SNMPv3: uses multiple security modules with V2 PDUs
And then the SMI version numbers (1 and 2) can be used with any protocol unless there are SMIv2 datatypes which can't be accessed with V1 PDUs (eg, counter64).
If you perform snmpbulkwalk using v1 then you will recieve the following error
bash# snmpbulkwalk -v 1 -Os -c demopublic test.net-snmp.org
No log handling enabled - using stderr logging
snmpbulkwalk: Cannot send V2 PDU on V1 session
as snmpbulkwalk introduced on v 2c, performing this will bring you the neat output, learn the concept
bash# snmpbulkwalk -v2c -Os -c demopublic test.net-snmp.org
sysDescr.0 = STRING: test.net-snmp.org
sysObjectID.0 = OID: netSnmpAgentOIDs.10
sysUpTimeInstance = Timeticks: (174391443) 20 days, 4:25:14.43
sysContact.0 = STRING: Net-SNMP Coders <net-snmp-coders@lists.sourceforge.net>
sysName.0 = STRING: test.net-snmp.org
sysLocation.0 = STRING: Undisclosed
sysORLastChange.0 = Timeticks: (7) 0:00:00.07
精彩评论