Blame man/snmptrapd.conf.5.def

Packit Service b38f0b
.TH SNMPTRAPD.CONF 5 "13 Mar 2014" VVERSIONINFO "Net-SNMP"
Packit Service b38f0b
.SH NAME
Packit Service b38f0b
snmptrapd.conf - configuration file for the Net-SNMP notification receiver
Packit Service b38f0b
.SH DESCRIPTION
Packit Service b38f0b
The Net-SNMP notification receiver (trap daemon) uses one or more
Packit Service b38f0b
configuration files to control its operation and how incoming traps
Packit Service b38f0b
(and INFORM requests) should be processed.
Packit Service b38f0b
This file (\fBsnmptrapd.conf\fR) can be located in
Packit Service b38f0b
one of several locations, as described in the
Packit Service b38f0b
.IR snmp_config (5)
Packit Service b38f0b
manual page.
Packit Service b38f0b
.SH IMPORTANT
Packit Service b38f0b
Previously,
Packit Service b38f0b
.B snmptrapd
Packit Service b38f0b
would accept all incoming notifications, and log them automatically
Packit Service b38f0b
(even if no explicit configuration was provided).
Packit Service b38f0b
Starting with release 5.3, access control checks will be applied to
Packit Service b38f0b
incoming notifications. If
Packit Service b38f0b
.B snmptrapd
Packit Service b38f0b
is run without a suitable configuration file (or equivalent access
Packit Service b38f0b
control settings), then such traps \fBWILL NOT\fR
Packit Service b38f0b
be processed.
Packit Service b38f0b
See the section \fBACCESS CONTROL\fR for more details.
Packit Service b38f0b
.PP
Packit Service b38f0b
As with the agent configuration, the
Packit Service b38f0b
.I snmptrapd.conf
Packit Service b38f0b
directives can be divided into four distinct groups.
Packit Service b38f0b
.SH TRAPD BEHAVIOUR
Packit Service b38f0b
.IP "snmpTrapdAddr [<transport-specifier>:]<transport-address>[,...]"
Packit Service b38f0b
defines a list of listening addresses, on which to receive
Packit Service b38f0b
incoming SNMP notifications.
Packit Service b38f0b
See the section 
Packit Service b38f0b
.B LISTENING ADDRESSES
Packit Service b38f0b
in the
Packit Service b38f0b
.IR snmpd (8)
Packit Service b38f0b
manual page for more information about the format of listening
Packit Service b38f0b
addresses.
Packit Service b38f0b
.IP
Packit Service b38f0b
The default behaviour is to
Packit Service b38f0b
listen on UDP port 162 on all IPv4 interfaces.
Packit Service b38f0b
.IP "doNotRetainNotificationLogs yes"
Packit Service b38f0b
disables support for the NOTIFICATION\-LOG\-MIB.
Packit Service b38f0b
Normally the snmptrapd program keeps a record of the traps
Packit Service b38f0b
received, which can be retrieved by querying
Packit Service b38f0b
the \fCnlmLogTable\fR and \fCnlmLogvariableTable\fR tables.  
Packit Service b38f0b
This directive can be used to suppress this behaviour.
Packit Service b38f0b
.IP
Packit Service b38f0b
See the 
Packit Service b38f0b
.IR snmptrapd (8) 
Packit Service b38f0b
manual page and the NOTIFICATION\-LOG\-MIB for details.
Packit Service b38f0b
.IP "doNotLogTraps yes"
Packit Service b38f0b
disables the logging of notifications altogether.
Packit Service b38f0b
This is useful if the \fBsnmptrapd\fR application should
Packit Service b38f0b
only run traphandle hooks and should not log traps to any location.
Packit Service b38f0b
.IP "doNotFork yes"
Packit Service b38f0b
do not fork from the calling shell.
Packit Service b38f0b
.IP "pidFile PATH"
Packit Service b38f0b
defines a file in which to store the process ID of the
Packit Service b38f0b
notification receiver.  By default, this ID is not saved.
Packit Service b38f0b
.SH ACCESS CONTROL
Packit Service b38f0b
Starting with release 5.3, it is necessary to explicitly specify
Packit Service b38f0b
who is authorised to send traps and informs to the notification
Packit Service b38f0b
receiver (and what types of processing these are allowed to trigger).
Packit Service b38f0b
This uses an extension of the VACM model, used in the main SNMP agent.
Packit Service b38f0b
.PP
Packit Service b38f0b
There are currently three types of processing that can be specified:
Packit Service b38f0b
.RS
Packit Service b38f0b
.IP "log"
Packit Service b38f0b
log the details of the notification - either in a specified file,
Packit Service b38f0b
to standard output (or stderr), or via \fIsyslog\fR (or similar).
Packit Service b38f0b
.IP "execute"
Packit Service b38f0b
pass the details of the trap to a specified handler program, including
Packit Service b38f0b
embedded perl.
Packit Service b38f0b
.IP "net"
Packit Service b38f0b
forward the trap to another notification receiver.
Packit Service b38f0b
.RE
Packit Service b38f0b
.PP
Packit Service b38f0b
In the following directives, \fITYPES\fR will be a (comma-separated)
Packit Service b38f0b
list of one or more of these tokens.  Most commonly, this will
Packit Service b38f0b
typically be \fIlog,execute,net\fR to cover any style of processing
Packit Service b38f0b
for a particular category of notification. But it is perfectly
Packit Service b38f0b
possible (even desirable) to limit certain notification sources to
Packit Service b38f0b
selected processing only.
Packit Service b38f0b
.IP "authCommunity   TYPES COMMUNITY  [SOURCE [OID | \-v VIEW ]]"
Packit Service b38f0b
authorises traps (and SNMPv2c INFORM requests) with the specified
Packit Service b38f0b
community to trigger the types of processing listed.
Packit Service b38f0b
By default, this will allow any notification using this community
Packit Service b38f0b
to be processed.  The SOURCE field can be used to specify that the
Packit Service b38f0b
configuration should only apply to notifications received from
Packit Service b38f0b
particular sources - see
Packit Service b38f0b
.IR snmpd.conf (5)
Packit Service b38f0b
for more details.
Packit Service b38f0b
.IP "authUser   TYPES [\-s MODEL] USER  [LEVEL [OID | \-v VIEW ]]"
Packit Service b38f0b
authorises SNMPv3 notifications with the specified
Packit Service b38f0b
user to trigger the types of processing listed.
Packit Service b38f0b
By default, this will accept authenticated requests.
Packit Service b38f0b
(\fIauthNoPriv\fR or \fIauthPriv\fR). The LEVEL field can
Packit Service b38f0b
be used to allow unauthenticated notifications (\fInoauth\fR),
Packit Service b38f0b
or to require encryption (\fIpriv\fR), just as for the SNMP agent.
Packit Service b38f0b
.IP
Packit Service b38f0b
With both of these directives, the OID (or \fI\-v VIEW\fR) field
Packit Service b38f0b
can be used to retrict this configuration to the processing of
Packit Service b38f0b
particular notifications.
Packit Service b38f0b
.RS
Packit Service b38f0b
.IP "Note:"
Packit Service b38f0b
Unlike the VACM processing described in RFC 3415, this view is
Packit Service b38f0b
\fBonly\fR matched against the \fCsnmpTrapOID\fR value of the
Packit Service b38f0b
incoming notification.  It is not applied to the payload varbinds
Packit Service b38f0b
held within that notification.
Packit Service b38f0b
.RE
Packit Service b38f0b
.IP "authGroup  TYPES [\-s MODEL] GROUP  [LEVEL [OID | \-v VIEW ]]"
Packit Service b38f0b
.IP "authAccess TYPES [\-s MODEL] GROUP VIEW  [LEVEL [CONTEXT]]"
Packit Service b38f0b
.IP "setAccess GROUP CONTEXT MODEL LEVEL PREFIX VIEW TYPES"
Packit Service b38f0b
authorise notifications in the specified GROUP
Packit Service b38f0b
(configured using the \fIgroup\fR directive)
Packit Service b38f0b
to trigger the types of processing listed.
Packit Service b38f0b
See
Packit Service b38f0b
.IR snmpd.conf (5)
Packit Service b38f0b
for more details.
Packit Service b38f0b
.IP "createUser [-e  ENGINEID] username (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) authpassphrase [DES|AES]"
Packit Service b38f0b
See the 
Packit Service b38f0b
.IR snmpd.conf (5)
Packit Service b38f0b
manual page for a description of how to create SNMPv3 users.  This
Packit Service b38f0b
is roughly the same, but the file name changes to snmptrapd.conf from
Packit Service b38f0b
snmpd.conf.
Packit Service b38f0b
.IP "disableAuthorization yes"
Packit Service b38f0b
will disable the above access control checks, and revert to the
Packit Service b38f0b
previous behaviour of accepting all incoming notifications.
Packit Service b38f0b
.IP
Packit Service b38f0b
.\" XXX - Explain why this is a Bad Idea
Packit Service b38f0b
.\"
Packit Service b38f0b
.SH LOGGING
Packit Service b38f0b
.IP "format1 FORMAT"
Packit Service b38f0b
.IP "format2 FORMAT"
Packit Service b38f0b
specify the format used to display SNMPv1 TRAPs and SNMPv2
Packit Service b38f0b
notifications respectively.  Note that SNMPv2c and SNMPv3
Packit Service b38f0b
both use the same SNMPv2 PDU format.
Packit Service b38f0b
.IP "format DESTINATION FORMAT"
Packit Service b38f0b
specify the format used for different destinations.
Packit Service b38f0b
DESTINATION is one of:
Packit Service b38f0b
.IR print ", " print1 ", " print2 ", " 
Packit Service b38f0b
.IR syslog ", " syslog1 ", " syslog2 ", " 
Packit Service b38f0b
.IR execute ", " execute1 ", " execute2 .
Packit Service b38f0b
.I print1
Packit Service b38f0b
is used for printing SNMPv1 traps,
Packit Service b38f0b
.I print2
Packit Service b38f0b
is for SNMPv2.
Packit Service b38f0b
.I print
Packit Service b38f0b
is used for both versions.
Packit Service b38f0b
.I syslog
Packit Service b38f0b
is similarly used when sending traps to syslog, and
Packit Service b38f0b
.I execute
Packit Service b38f0b
used when sending traps to a program such as
Packit Service b38f0b
.IR traptoemail (1).
Packit Service b38f0b
.IP
Packit Service b38f0b
The default formats are
Packit Service b38f0b
.br
Packit Service b38f0b
.I format print1 %.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b] (via %A [%a]): %N\en\et%W Trap (%q) Uptime: %#T\en%v\en
Packit Service b38f0b
.br
Packit Service b38f0b
.I format print2 %.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b]:\en%v\en
Packit Service b38f0b
.br
Packit Service b38f0b
.I format syslog1 %a: %W Trap (%q) Uptime: %#T%#v\en
Packit Service b38f0b
.br
Packit Service b38f0b
.I format syslog2 %B [%b]: Trap %#v\en
Packit Service b38f0b
.br
Packit Service b38f0b
.I format execute %B\en%b\en%V\en%v\en
Packit Service b38f0b
.IP
Packit Service b38f0b
See
Packit Service b38f0b
.IR snmptrapd (8)
Packit Service b38f0b
for the layout characters available.
Packit Service b38f0b
.IP "ignoreAuthFailure yes"
Packit Service b38f0b
instructs the receiver to ignore \fIauthenticationFailure\fR traps.
Packit Service b38f0b
.RS
Packit Service b38f0b
.IP Note:
Packit Service b38f0b
This currently only affects the logging of such notifications.
Packit Service b38f0b
\fIauthenticationFailure\fR traps will still be passed to trap
Packit Service b38f0b
handler scripts, and forwarded to other notification receivers.
Packit Service b38f0b
This behaviour should not be relied on, as it is likely
Packit Service b38f0b
to change in future versions.
Packit Service b38f0b
.RE
Packit Service b38f0b
.IP "logOption string"
Packit Service b38f0b
specifies where notifications should be logged - to standard
Packit Service b38f0b
output, standard error, a specified file or via \fIsyslog\fR.
Packit Service b38f0b
See the section LOGGING OPTIONS in the
Packit Service b38f0b
.IR snmpcmd (1)
Packit Service b38f0b
manual page for details.
Packit Service b38f0b
.IP "outputOption string"
Packit Service b38f0b
specifies various characteristics of how OIDs and other values
Packit Service b38f0b
should be displayed.
Packit Service b38f0b
See the section OUTPUT OPTIONS in the
Packit Service b38f0b
.IR snmpcmd (1)
Packit Service b38f0b
manual page for details.
Packit Service b38f0b
.SH MySQL Logging
Packit Service b38f0b
There are two configuration variables that work together to control
Packit Service b38f0b
when queued traps are logged to the MySQL database. A non-zero
Packit Service b38f0b
value must be specified for sqlSaveInterval to enable MySQL logging.
Packit Service b38f0b
.RE
Packit Service b38f0b
.IP "sqlMaxQueue max"
Packit Service b38f0b
specifies the maximum number of traps to queue before a forced flush
Packit Service b38f0b
to the MySQL database.
Packit Service b38f0b
.RE
Packit Service b38f0b
.IP "sqlSaveInterval seconds"
Packit Service b38f0b
specified the number of seconds between periodic queue flushes.
Packit Service b38f0b
A value of 0 for will disable MySQL logging.
Packit Service b38f0b
.SH NOTIFICATION PROCESSING
Packit Service b38f0b
As well as logging incoming notifications, they can also
Packit Service b38f0b
be forwarded on to another notification receiver, or passed
Packit Service b38f0b
to an external program for specialised processing.
Packit Service b38f0b
.IP "traphandle OID|default PROGRAM [ARGS ...]"
Packit Service b38f0b
invokes the specified program (with the given arguments) whenever a
Packit Service b38f0b
notification is received that matches the OID token.  For SNMPv2c and
Packit Service b38f0b
SNMPv3 notifications, this token will be compared against the
Packit Service b38f0b
\fCsnmpTrapOID\fR value taken from the notification.  For SNMPv1 traps,
Packit Service b38f0b
the generic and specific trap values and the enterprise OID will be
Packit Service b38f0b
converted into the equivalent OID (following RFC 2576).
Packit Service b38f0b
.IP
Packit Service b38f0b
Typically, the OID token will be the name (or numeric OID) of a
Packit Service b38f0b
NOTIFICATION-TYPE object, and the specified program will be invoked for
Packit Service b38f0b
notifications that match this OID exactly.  However this token also
Packit Service b38f0b
supports a simple form of wildcard suffixing.  By appending the character
Packit Service b38f0b
\'*' to the OID token, the corresponding program will be invoked for any
Packit Service b38f0b
notification based within subtree rooted at the specified OID.
Packit Service b38f0b
For example, an OID token of \fC.1.3.6.1.4.1*\fP would match any enterprise
Packit Service b38f0b
specific notification (including the specified OID itself).
Packit Service b38f0b
An OID token of \fC.1.3.6.1.4.1.*\fP would would work in much the same way,
Packit Service b38f0b
but would not match this exact OID - just notifications that lay strictly
Packit Service b38f0b
below this root.
Packit Service b38f0b
Note that this syntax does not support full regular expressions or
Packit Service b38f0b
wildcards - an OID token of the form \fCoid.*.subids\fR is \fBnot\fC valid.
Packit Service b38f0b
.IP
Packit Service b38f0b
If the OID field is the token \fIdefault\fR then the program will be
Packit Service b38f0b
invoked for any notification not matching another (OID specific)
Packit Service b38f0b
\fItraphandle\fR entry.
Packit Service b38f0b
.PP
Packit Service b38f0b
Details of the notification are fed to the program via its standard input.
Packit Service b38f0b
Note that this will always use the SNMPv2-style notification format, with
Packit Service b38f0b
SNMPv1 traps being converted as per RFC 2576, before being passed to the
Packit Service b38f0b
program.
Packit Service b38f0b
The input format is, if you use the default set by
Packit Service b38f0b
the "format execute %B\en%b\en%V\en%v\en", one entry per line:
Packit Service b38f0b
.RS
Packit Service b38f0b
.IP HOSTNAME
Packit Service b38f0b
The name of the host that sent the notification, as determined by
Packit Service b38f0b
.IR gethostbyaddr (3).
Packit Service b38f0b
.br
Packit Service b38f0b
.IP ADDRESS
Packit Service b38f0b
The transport address, like
Packit Service b38f0b
.br
Packit Service b38f0b
"[UDP: [172.16.10.12]:23456->[10.150.0.8]]"
Packit Service b38f0b
.\"
Packit Service b38f0b
.\" XXX - What about non-IPv4 transports?
Packit Service b38f0b
.\"
Packit Service b38f0b
.IP VARBINDS
Packit Service b38f0b
A list of variable bindings describing the contents of the notification,
Packit Service b38f0b
one per line.  The first token on each line (up until a space) is the
Packit Service b38f0b
OID of the varind, and the remainder of the line is its value.
Packit Service b38f0b
The format of both of these are controlled by the \fIoutputOption\fR
Packit Service b38f0b
directive (or similar configuration).
Packit Service b38f0b
.IP
Packit Service b38f0b
The first OID should always be \fCSNMPv2\-MIB::sysUpTime.0\fR,
Packit Service b38f0b
and the second should be \fCSNMPv2\-MIB::snmpTrapOID.0\fR.
Packit Service b38f0b
The remaining lines will contain the payload varbind list.
Packit Service b38f0b
For SNMPv1 traps, the final OID will be \fCSNMPv2\-MIB::snmpTrapEnterprise.0\fR.
Packit Service b38f0b
.br
Packit Service b38f0b
.IP Example:
Packit Service b38f0b
A \fBtraptoemail\fR script has been included in the Net-SNMP package that
Packit Service b38f0b
can be used within a \fItraphandle\fR directive:
Packit Service b38f0b
.br
Packit Service b38f0b
.RS
Packit Service b38f0b
.P
Packit Service b38f0b
traphandle default /usr/bin/perl BINDIR/traptoemail \-s mysmtp.somewhere.com \-f admin@somewhere.com me@somewhere.com
Packit Service b38f0b
.RE
Packit Service b38f0b
.RE
Packit Service b38f0b
.IP "forward OID|default DESTINATION"
Packit Service b38f0b
forwards notifications that match the specified OID
Packit Service b38f0b
to another receiver listening on DESTINATION.
Packit Service b38f0b
The interpretation of OID (and \fIdefault\fR) is the same
Packit Service b38f0b
as for the \fItraphandle\fR directive).
Packit Service b38f0b
.IP
Packit Service b38f0b
See the section 
Packit Service b38f0b
.B LISTENING ADDRESSES
Packit Service b38f0b
in the
Packit Service b38f0b
.IR snmpd (8)
Packit Service b38f0b
manual page for more information about the format of listening
Packit Service b38f0b
addresses.
Packit Service b38f0b
.RE
Packit Service b38f0b
.SH NOTES
Packit Service b38f0b
.IP o
Packit Service b38f0b
The daemon blocks while executing the \fItraphandle\fR commands.
Packit Service b38f0b
(This should
Packit Service b38f0b
be fixed in the future with an appropriate signal catch and wait()
Packit Service b38f0b
combination).
Packit Service b38f0b
.IP o
Packit Service b38f0b
All directives listed with a value of "yes" actually accept a range
Packit Service b38f0b
of boolean values.  These will accept any of \fI1\fR, \fIyes\fR or
Packit Service b38f0b
\fItrue\fR to enable the corresponding behaviour, 
Packit Service b38f0b
or any of \fI0\fR, \fIno\fR or \fIfalse\fR to disable it.
Packit Service b38f0b
The default in each case is for the feature to be turned off, so these
Packit Service b38f0b
directives are typically only used to enable the appropriate behaviour.
Packit Service b38f0b
.SH FILES
Packit Service b38f0b
SYSCONFDIR/snmp/snmptrapd.conf
Packit Service b38f0b
.SH "SEE ALSO"
Packit Service b38f0b
snmp_config(5), snmptrapd(8), syslog(8), traptoemail(1), variables(5), netsnmp_config_api(3).
Packit Service b38f0b