[SNMP4J] Adding static scalars to SNMP4J-Agent

Frank Fock fock at agentpp.com
Wed Nov 8 17:53:36 CET 2006


Hi Arnoud,

This task is really simple, just use the

  MOScalar createScalar(OID id, MOAccess access, Variable value)

method of the DefaultMOFactory and then
register the returned MOScalar with MOServer.register:

DefaultMOFactory moFactory = new DefaultMOFactory();
MOScalar myStaticScalar =
   moFactory.createScalar(oidIfNumber0, AccessImpl.ACCESS_READ_ONLY,
                          new Integer32(1/*ifNumber*/));
moServer.register(myStaticScalar, null);

Best regards,
Frank


Arnoud Zwemmer wrote:
> Hi,
>  
> I'm trying to understand how to add MIBs to the SNMP4J-Agent (using
> generated code). The ifMIB sample provides a sample of adding static
> rows to the ifTable. I was wondering what's the correct way to add
> static scalars, for example ifNumber? 
>  
> Thanks,
> 
> Arnoud.
>  
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list