Question

I am using latest version of pysnmp 4.2.4 and have tested the SNMPV1/2C command responder example (http://pysnmp.sourceforge.net/examples/current/v1arch/agent/cmdrsp.html) which is returning an Uptime value in response to OID 1,3,6,1,2,1,1,3,0

I have used the V3 responder example (http://pysnmp.sourceforge.net/examples/current/v3arch/agent/cmdrsp/v3-multiple-users.html) and have that returning the system value (none) for 1,3,6,1,2,1,1,3,0.

How can I add a call back to the V3 version so that it calls an Uptime class similar to the V1 version (and returns a local value)?

TIA Steve

Was it helpful?

Solution

The v3 model introduces a notion of MIB instrumentation controller class which provides callbacks - one for read and the other for set operations. Stock MIB controller implementation invokes Managed Object Instances Python objects (each identified by an OID) to get/set their values.

So you could either setup your own MibInstrumentatonController class (see EchoMibInstrumController here) or use stock MIB controller with your own Managed Object Instances (see MyStaticMibScalarInstance here).

The SNMPv3 settings in these examples are slightly different but that is not relevant to MIB implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top