How to write a code sending user defined traps by using Net-SNMP API

1.6k views Asked by At

Can we write the code for sending user defined traps rather than those mentioned in snmpd using Net-SNMP API like below to send traps netsnmp_send_traps(), send_v2trap(), send_v3trap()?

I am not planning to write any MIB module. So I don't expect that my trap should be going through snmpd (Agent Daemon).

The idea I want to implement is that sending trap from external code to snmptrapd which will receive traps and forward it to configured trap receiver to get more familiar with Net-SNMP library.

1

There are 1 answers

0
Chaitanya Gulhane On BEST ANSWER

There is no Net-SNMP API provided. We can just fork-exec Net-SNMP command to send trap.