On 21/04/2008, Paul Po**** wrote:
> I want to use a MIB in my application but don't know how to specify one
> - comparable to the -m argument in snmp v3 calls.

If you are using the 'snmp_parse_args()' API to handle command-line
options, then this will support the '-m' flag automatically.

Otherwise, simply set the environmental variable 'MIBS' within your code:

setenv("MIBS", "My-MIB", 1);

> Can I specify a MIB or can I only use numeric ID's such as:
> read_objid(".", anOID, &anOID_len);

No - you can definitely use MIB object names.
In fact, if you use something like

read_objid("My-MIB::myObject", anOID, &anOID_len);

then you don't need the 'setenv' call at all.


This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
Net-snmp-users mailing list
Please see the following page to unsubscribe or change other options: