Search code examples
javasnmpsnmp4j

SNMP: snmp4j / snmpwalk result differs


I'm sending a requests for snmp nodes using this example:

PDU pdu = new PDU();
pdu.add(new VariableBinding(new OID("1.3.6.1.2.1.1.1")));
pdu.add(new VariableBinding(new OID("1.3.6.1.2.1.1.9.1.2.1")));
pdu.setType(PDU.GETNEXT);

and results are:

Linux pia 2.6.26-2-686 #1 SMP Thu Sep 16 19:35:51 UTC 2010 i686
1.3.6.1.6.3.11.3.1.1

using listener:

Received response PDU is: RESPONSE[requestID=307256023, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.9.1.2.2 = 1.3.6.1.6.3.11.3.1.1]]

and snmpwalk commands gives me these results:

root@pia:~/workspace_c/SNMP# snmpwalk -v2c -c public localhost 1.3.6.1.2.1.1.1
SNMPv2-MIB::sysDescr.0 = STRING: Linux pia 2.6.26-2-686 #1 SMP Thu Sep 16 19:35:51 UTC 2010 i686

root@pia:~/workspace_c/SNMP# snmpwalk -v2c -c public localhost 1.3.6.1.2.1.1.9.1.2.1
SNMPv2-MIB::sysORID.1 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance

Why snmpwalk returns SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance and snmp4j 1.3.6.1.6.3.11.3.1.1 ?

Why I've got the name of node in first case and the number of node in second???

UPDATE: Aha, it seems the nodes can be OID, STRING, Timesticks object:

  • 1.3.6.1.2.1.1.9.1.2.1 => OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
  • 1.3.6.1.2.1.1.9.1.3.1 => STRING: The SNMP Management Architecture MIB.

Solution

  • Isn't it exactly the same? (SNMP OIDs may be in the form of strings or "numbers with dots" - different representation but points to exactly the same information in tree).

    From MIBExplorer:

    snmpMPDCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The compliance statement for SNMP entities which implement the SNMP-MPD-MIB. "

        MODULE 
        MANDATORY-GROUPS {
                        snmpMPDGroup }
    

    -- 1.3.6.1.6.3.11.3.1.1 -- ::= { snmpMPDMIBCompliances 1 }