In the snmptrapd.conf trap configuration file you define 2 pieces of information that tells snmptrapd how to direct the incoming traps: the OID of the incoming trap and the location of the traphandler to pass the incoming trap information to including any arguments you want passed to the trap handler.
The following is an example of a snmptrapd.conf:
### Format: traphandle (OID) (Trap Handler) (Trap Handler Args...) #extremeModuleStateChanged traphandle .18.104.22.168.4.1.1916.0.15 /path/to/traphandle.pl statechange #extremeHealthCheckFailed traphandle .22.214.171.124.4.1.19126.96.36.199.1 /path/to/traphandle.pl healthcheck #extremeCpuHealthCheckFailed traphandle .188.8.131.52.4.1.1916.0.22 /path/to/traphandle.pl cpuhealthcheck # Default Handler traphandle default /path/to/traphandle.pl
In this configuration file the same trap handler is used in all 4 lines uncommented line, but based on the trap OID different arguments are passed to allow the trap handler to react in different ways. If you supply the OID in numeric format it is wide to add a comment describing the traps MIB name. The final line uses the keyword "default" instead of an OID, which acts as a catch all to handle any traps that weren't processed by an earlier trap handler.