Download ActiveSocket    |     Visit the ActiveSocket website

Index - Log in! - Sign up! - Visit website
Getnext() or Walk()
 
ActiveXperts Software Forum Index -> ActiveSocket Toolkit -> Communication Protocols
 
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mike12345



Joined: 16 Jan 2008
Posts: 2

PostPosted: Wed Jan 16, 2008 9:40 am    Post subject: Getnext() or Walk()

I'm trying to get all Values from a subtree via SNMP-Getnext().
According to RFC1157 this should work without any problems. Unfortunatly if i'm using this library i have to set my OID with SNMP-GET() first (which correctly returns 22226).
The code looks like this:

Code:

            objSnmp = (SnmpObject)objSnmpManager.Get(".1.3.6.1.4.1.14179.2.5.10");
            Console.WriteLine("GET \t\t--> Errorcode: "+ objSnmpManager.LastError.ToString() + " - " +objSnmpManager.GetErrorDescription(objSnmpManager.LastError));
            objSnmp = (SnmpObject)objSnmpManager.GetNext();
            Console.WriteLine("GETNEXT \t--> Errorcode: " + objSnmpManager.LastError.ToString() + " - " + objSnmpManager.GetErrorDescription(objSnmpManager.LastError));
            while (objSnmpManager.LastError == 0)
            {
                Console.WriteLine(objSnmp.OID);
                Console.WriteLine(GetValueType(objSnmp.Type) + "Value: " + objSnmp.Value);
                objSnmp = (SnmpObject)objSnmpManager.GetNext();
            }


Is there a better way to get all values from a subtree ?
Back to top
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum