

The second argument is a reference to an array containing the variable bindings (OID and value information) that define the noification itself. The first is a reference to a hash containing information about how the trap was received (what version of the SNMP protocol was used, where it came from, what SNMP user name or community name it was sent under, etc). Registered functions are called with 2 arguments. Within the nf file, the keyword "perl" may be used to call any perl expression and using this ability, you can use the NetSNMP::TrapReceiver module to register functions which will be called every time a given notification (a trap or an inform) is received. It is intended solely for embedded use within the snmptrapd demon. This module can NOT be used in a normal perl script to receive traps. Registration of functions is then done through the nf configuration file. Net-SNMP MUST have been configured using -enable-embedded-perl. The NetSNMP::TrapReceiver module is used to register perl subroutines into the Net-SNMP snmptrapd process. Put the following lines in your nf file: perl NetSNMP::TrapReceiver::register("trapOID", \&myfunc) ABSTRACT NetSNMP::TrapReceiver - Embedded perl trap handling for Net-SNMP's snmptrapd SYNOPSIS
