1 .\" /***********************************************************
2 .\" Copyright 1989 by Carnegie Mellon University
4 .\" All Rights Reserved
6 .\" Permission to use, copy, modify, and distribute this software and its
7 .\" documentation for any purpose and without fee is hereby granted,
8 .\" provided that the above copyright notice appear in all copies and that
9 .\" both that copyright notice and this permission notice appear in
10 .\" supporting documentation, and that the name of CMU not be
11 .\" used in advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
14 .\" CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 .\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 .\" CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 .\" ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 .\" WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 .\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
21 .\" ******************************************************************/
22 .TH SNMPTRAPD 8 "07 Feb 2002" VVERSIONINFO "Net-SNMP"
25 snmptrapd - Receive and log SNMP trap messages.
27 .BR snmptrapd " [OPTIONS] [LISTENING ADDRESSES]"
30 is an SNMP application that receives and logs SNMP TRAP and INFORM
33 Note: the default is to listen on UDP port 162 on all IPv4 interfaces.
34 Since 162 is a privileged port,
36 must be typically be run as root.
40 Ignore authenticationFailure traps.
45 as a configuration file.
48 Do not read any configuration files except the one optionally specified by the
53 Dump (in hexadecimal) the sent and received SNMP packets.
56 Turn on debugging output for the given
60 for extremely verbose output.
63 Print event numbers (rising/falling alarm etc.).
66 Do not fork() from the calling shell.
69 When logging to standard output, use the format in the string
72 .B FORMAT SPECIFICATIONS
73 below for more details.
76 Display a brief usage message and then exit.
79 Display a list of configuration file directives understood by the
80 trap daemon and then exit.
83 Specifies the syslog facility to use when logging to syslog. 'd' means
86 .BR LOG_LOCAL0 " through " LOG_LOCAL7 ". " LOG_LOCAL0 " is the default."
89 Specifies a colon separated list of MIB modules to load for this
90 application. This overrides the environment variable MIBS.
93 Specifies a colon separated list of directories to search for MIBs.
94 This overrides the environment variable MIBDIRS.
97 Do not attempt to translate source addresses of incoming packets into
101 Log formatted incoming traps to
103 Upon receipt of a SIGHUP, the daemon will close and re-open
104 the log file. This feature is useful when rotating the log file with
105 other utilities such as logrotate.
108 Print formatted incoming traps to stderr.
111 Log formatted incoming traps to syslog. These syslog messages are
114 and facility as determined by the
115 .BR -l " flag (" LOG_LOCAL0
116 by default). This is the default unless the
121 Save the process ID of the trap daemon in
125 Print version information for the trap daemon and then exit.
129 takes the same output formatting
131 options as the other Net-SNMP commands. See the section
136 .SH FORMAT SPECIFICATIONS
139 interprets format strings similarly to
141 It understands the following formatting sequences:
148 decimal number of seconds since the operating system's epoch (as
153 current year on the local system
156 current (numeric) month on the local system
159 current day of month on the local system
162 current hour on the local system
165 current minute on the local system
168 current second on the local system
171 the value of the sysUpTime.0 varbind in seconds
174 the year field from the sysUpTime.0 varbind
177 the numeric month field from the sysUpTime.0 varbind
180 the day of month field from the sysUpTime.0 varbind
183 the hour field from the sysUpTime.0 varbind
186 the minute field from the sysUpTime.0 varbind
189 the seconds field from the sysUpTime.0 varbind
192 the contents of the agent-addr field of the PDU (v1 TRAPs only)
195 the hostname corresponding to the contents of the agent-addr field of
196 the PDU, if available, otherwise the contents of the agent-addr field
197 of the PDU (v1 TRAPs only).
200 PDU source address (Note: this is not necessarily an IPv4
204 PDU source hostname if available, otherwise PDU source address (see
211 trap type (numeric, in decimal)
217 trap sub-type (numeric, in decimal)
220 security information from the PDU (community name for v1/v2c,
221 user and context for v3)
224 list of trap's variable-bindings
227 In addition to these values, you may also specify an optional field
228 width and precision, just as in
230 and a flag value. The following flags are legal:
243 The "use alternate form" flag changes the behavior of some format
244 flags. Normally, the fields that display time information base it on
245 the local timezone, but this flag tells them to use GMT instead.
246 Also, the variable-binding list is normally a tab-separated list, but
247 this flag changes it to a comma-separated one. The alternate form for
248 the uptime is similar to "3 days, 0:14:34.65"
251 To get a message like "14:03 TRAP3.1 from humpty.ucd.edu" you
252 could use something like this:
256 snmptrapd -P -F "%02.2h:%02.2j TRAP%w.%q from %A\en"
260 If you want the same thing but in GMT rather than local time, use
264 snmptrapd -P -F "%#02.2h:%#02.2j TRAP%w.%q from %A\en"
267 .SH LISTENING ADDRESSES
270 listens for incoming SNMP TRAP and INFORM packets on UDP port 162 on
271 all IPv4 interfaces. However, it is possible to modify this behaviour
272 by specifying one or more listening addresses as arguments to
276 manual page for more information about the format of listening
278 .SH NOTIFICATION-LOG-MIB SUPPORT
279 As of net-snmp 5.0, the snmptrapd application supports the
280 NOTIFICATION-LOG-MIB. It does this by opening an AgentX subagent
281 connection to the master snmpd agent and registering the notification
282 log tables. As long as the snmpd application is started first, it
283 will attach itself to it and thus you should be able to view the last
284 recorded notifications via the nlmLogTable and nlmLogVariableTable.
285 See the snmptrapd.conf file and the "dontRetainLogs" token for turning
286 off this support. See the NOTIFICATION-LOG-MIB for more details about
288 .SH EXTENSIBILITY AND CONFIGURATION
293 snmpcmd(1), snmpd(8), printf(3), snmptrapd.conf(5), syslog(8), variables(5)