[SNMP4J] How to get attributes of object ?

Frank Fock fock at agentpp.com
Fri Mar 27 18:08:35 CET 2009


Hi Mark,

To get the SMI information and use it
your code, you will have to modify the
code generation templates to define
constants in your code that hold, for example
the description text.

The MIB information can be accessed through
the interfaces defined in the "doc" folder
of AgenPro. Typically, the IObjectType interface
is the starting point.

Does this help?

Best regards,
Frank

Mark Clements wrote:
> Hi,
>  
> A very simple question that probably demonstrates my newness to the
> SNMP4J Agent world!
> We have a working Agent (based on the TestAgent), from an ASN.1 MIB
> processed by the AgenGen tool.
> Everything is working fine (gets/sets/traps work etc).
>  
> But, if I have an object defined in the MIB, how do I access the
> attributes of the object, e.g. the Description (or any other attributes
> that I define)?
> I can identify and lookup an object by its OID but I don't know how to
> get the object's attributes !!
> 
> E.g. a simple object we have in our MIB, and processed by AgenPro to be
> used by the TestAgent:
>  
> scalone OBJECT-TYPE
>         SYNTAX Unsigned32 (0..1000000)
>         UNITS
>                 "1/1000 seconds."
>         MAX-ACCESS read-write
>         STATUS current
>         DESCRIPTION
>                 "Simple Scaler Test 1 for reading and writing an
> unsigned 32"
>     -- 1.3.6.1.4.1.162.1.1.1  --
>     ::= { tpvfMIBObjects 1 }
>  
>  
> How to get e.g. the description attribute (or any other attribute that I
> defined in the OBJECT-TYPE?
>  
> Thanks in advance !!
> Mark.
> _______________________________________________
> 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