Fulko Hew | 12 Apr 22:09 2012

Re: agentx: how do I register my traps

On Thu, Apr 12, 2012 at 3:17 PM, Stéphane Charette <stephanecharette <at> gmail.com> wrote:
Just joined the list 30 seconds ago.  :)  I'm working with net-snmp and agentx. I have to register my enterprise OIDs for scalars and tables. For example:

> netsnmp_register_read_only_scalar(...); // register my scalars
> netsnmp_tdata_register(...); // register my table

Until I make those calls in my agentx code, my OIDs don't show up in snmpd.

My MIB file also has NOTIFICATION-TYPE definitions, such as:

>     STATUS          current
>     DESCRIPTION     "A sample trap."
>     ::= { myNotifications 1 }

I took a look at #include <net-snmp/agent/agent_trap.h> but this file seems to be about sending traps, not registering custom ones.

My question: What do I call to register my trap definitions?

You need to 'register' variables/tables so that the master
agent knows which sub-agent to call/invoke (you versus the other guy)
when a particular OID is get/set, but...

You don't have to 'register' trap definitions, you simply have to
'send' the (correctly composed) notification (agentx-Notify-PDU).

... because here, _you_ are the one in control, and the master (in this
case) doesn't care where the notification is originating from or
what it contains.  It is simply re- formats what it gets and directs
your notifications to the configured NMSs.

For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options: