Re: Is there a simple/standard way to access other modules oids from within a mib module?
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 12/01/2008, Manfred Wassmann <[email protected]> wrote: > I am writing a MIB module for some specific piece of hardware. Some of > my code needs to return values that are already available from > standard MIB modules..... I'd like to use the values already > available from standard modules. Is that possible? The simplest approach is probably to use the "internal query" mechanism, as used in the DisMan Event MIB module. Something like: netsnmp_session *sess = netsnmp_iquery_user_session("user"); netsnmp_variable_list var = // the varbind(s) you want to retrieve netsnmp_query_get( &var, sess ); or even netsnmp_query_get( &var, netsnmp_query_get_default_session()); This requires you to have set up the specified SNMPv3 user (with read permission for the relevant OIDs), or a default "agentSecName". See the snmpd.conf(5) man page info on setting up the "monitor" directive for more details. Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users