next up previous contents
Next: A Simple Trap Handler Up: Trap Handlers Previous: Trap Handlers   Contents

The Trap Daemon Configuration

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...)
traphandle  . /path/to/ statechange

traphandle  . /path/to/ healthcheck

traphandle  . /path/to/ cpuhealthcheck

# Default Handler
traphandle  default /path/to/

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.