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:
myTrapTest NOTIFICATION-TYPE
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?
Turns out there is no registration required for traps. When I asked on the NET-SNMP mailing list, the answer I received was:
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).
(Source: http://permalink.gmane.org/gmane.network.net-snmp.user/35320 )