mibble-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mibble-users] snmpwalk and the loading the MIB files


From: punit gupta
Subject: [Mibble-users] snmpwalk and the loading the MIB files
Date: Mon, 13 Dec 2004 12:56:03 -0800 (PST)

Hello Sir,

I am building an application to do snmpwalk for a
given OID. It works fine except in the case when a
particular OID is of type DisplayString. I am not able
to get the children of the such ObjectIdentifierValue
objects. For example if I do the snmpwalk using the
linux's snmpwalk command with
"1.3.6.1.4.1.5596.10.3.4.1.3" for a given ID, it gives
me following output:

SNMPv2-SMI::enterprises.5596.10.3.4.1.3.1 = STRING:
"130.207.179.65"
SNMPv2-SMI::enterprises.5596.10.3.4.1.3.2 = ""
SNMPv2-SMI::enterprises.5596.10.3.4.1.3.3 = ""
SNMPv2-SMI::enterprises.5596.10.3.4.1.3.4 = ""

When I try the same functionality with my custom built
snmpwalk using the mibble api, it only gives me the
first one correctly. Here is the code:

private static void printOid(ObjectIdentifierValue
objectidentifiervalue)
{
 if(objectidentifiervalue.getChildCount() == 0)
  try
  {
   SnmpManager snmpmanager = SnmpManager.createSNMPv1
(host, port, community);
   String s = objectidentifiervalue.toString();
   
   try
   {
   SnmpResponse snmpresponse = snmpmanager.getNext(s);
  
System.out.println(snmpresponse.getOidsAndValues());
   }
   catch(SnmpException snmpexception1)
   {
      System.out.println("error occured");
   }
  }
  catch(SnmpException snmpexception)
  {
  System.out.println("snmpManager can not be created
:" + snmpexception.getMessage());
  }

  for(int i = 0; i <
objectidentifiervalue.getChildCount(); i++)
 {
   printOid(objectidentifiervalue.getChild(i));
  }
 }


When I use the getNext method of SNMPManager on a OID
which is "child" of a OID Of type DisplayString, it
still gives me the first "child" of the OID
(displayString).

I think it has something to do with DisplayString.
Since the children of DisplayString type OID are not
listed in the mib (right??), they do not appear in the
getChildren method also.

Any suggestions would be appreciated.
Thanks bunch,
-Punit.


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail




reply via email to

[Prev in Thread] Current Thread [Next in Thread]