Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / snmp / man / snmpd.conf.5.def
blob29850860d6b88b566a38f7689de5f0966ffb925f
1 .TH SNMPD.CONF 5 "28 Feb 2003" VVERSIONINFO "Net-SNMP"
2 .UC 4
3 .SH NAME
4 SYSCONFDIR/snmp/snmpd.conf - configuration file for the Net-SNMP SNMP agent.
5 .SH DESCRIPTION
6 .B snmpd.conf
7 is the configuration file which defines how the Net-SNMP SNMP agent
8 operates. These files may contain any of the directives found in the
9 .B DIRECTIVES
10 section below. This file is not required for the agent to
11 operate and respond to requests.
12 .SH PLEASE READ FIRST
13 First, make sure you have read the
14 .I snmp_config(5)
15 manual page that describes how the Net-SNMP configuration files
16 operate, where they are located and how they all work together.
17 .PP
18 Also, you might consider looking into the
19 .B snmpconf
20 application (perl script) which can help you build an snmpd.conf file
21 by prompting you for information. You should try it. Really. Go
22 ahead. Right now. Run:
23 .RS
24 .IP "snmpconf -g basic_setup"
25 .RE
26 .PP
27 to get you started. See the
28 .I snmpconf(1)
29 manual page for more information.
30 .SH EXTENSIBLE-MIB
31 .PP
32 The Net-SNMP SNMP agent reports much of its information through
33 queries to the EXTENSIBLEDOTMIB section of the MIB tree. Every MIB in
34 this section has the following table entries in it.
35 .IP ".MIBINDEX -- index"
36 This is the table's index numbers for each of the DIRECTIVES listed below.
37 .IP ".ERRORNAME -- name"
38 The name of the given table entry. This should be unique, but is not
39 required to be.
40 .IP ".ERRORFLAG -- errorFlag"
41 This is a flag returning either the integer value 1 or 0 if an error
42 is detected for this table entry.
43 .IP ".ERRORMSG -- errorMsg"
44 This is a DISPLAY-STRING describing any error triggering the errorFlag above.
45 .IP ".ERRORFIX -- errorFix"
46 If this entry is set to the integer value of 1 AND the errorFlag
47 defined above is indeed a 1, a program or script will get executed
48 with the table entry name from above as the argument. The program to
49 be executed is configured in the config.h file at compile time.
50 .SS Directives
51 .IP "proc NAME"
52 .IP "proc NAME MAX"
53 .IP "proc NAME MAX MIN"
54 .IP
55 Checks to see if processes called NAME are running on the agent
56 machine. An error flag (1) and a description message are then passed
57 to the EXTENSIBLEDOTMIB.PROCMIBNUM.1.ERRORFLAG and
58 EXTENSIBLEDOTMIB.PROCMIBNUM.1.ERRORMSG MIB columns (respectively) if
59 the NAME'd program is not found in the process table as reported by
60 PSCMD.
61 .IP
62 If MAX and MIN are not specified, MAX is assumed to be
63 .B infinity
64 and MIN is assumed to be 1.
65 .IP
66 If MAX is specified but MIN is not specified, MIN is assumed to be 0.
67 .IP "procfix NAME PROG ARGS"
68 This registers a command that knows how to fix errors with the given
69 process NAME. When EXTENSIBLEDOTMIB.PROCMIBNUM.1.ERRORFIX for a given
70 NAMEd program is set to the integer value of 1, this command will be
71 called. It defaults to a compiled value set using the PROCFIXCMD
72 definition in the config.h file.
73 .IP "exec NAME PROG ARGS"
74 .IP "exec MIBNUM NAME PROG ARGS"
75 .IP
76 If MIBNUM is not specified, the agent executes the named PROG with
77 arguments of ARGS and returns the exit status and the first line of
78 the STDOUT output of the PROG program to queries of the
79 EXTENSIBLEDOTMIB.SHELLMIBNUM.1.ERRORFLAG and
80 EXTENSIBLEDOTMIB.SHELLMIBNUM.1.ERRORMSG mib columns (respectively). All
81 STDOUT output beyond the first line is silently truncated.
82 .IP
83 If MIBNUM is specified, it acts as above but returns the exit status
84 to MIBNUM.ERRORFLAG.0 and the entire STDOUT output to the table
85 MIBNUM.ERRORMSG in a MIB table. In this case, the MIBNUM.ERRORMSG mib
86 contains the entire STDOUT output, one MIB table entry per line of
87 output (ie, the first line is output as MIBNUM.ERRORMSG.1, the second
88 at MIBNUM.ERRORMSG.2, etc...).
89 .RS
90 .IP Note:
91 The MIBNUM must be specified in dotted-integer notation and can
92 not be specified as ".iso.org.dod.internet..." (should instead
93 be .1.3.6.1...).
94 .IP Note:
95 The agent caches the exit status and STDOUT of the executed program
96 for 30 seconds after the initial query. This is to increase speed and
97 maintain consistency of information for consecutive table queries.
98 The cache can be flushed by a snmp-set request of integer(1) to
99 EXTENSIBLEDOTMIB.VERSIONMIBNUM.VERCLEARCACHE.
101 .IP "execfix NAME PROG ARGS"
102 This registers a command that knows how to fix errors with the given
103 exec or sh NAME. When EXTENSIBLEDOTMIB.SHELLMIBNUM.1.ERRORFIX for a
104 given NAMEd entry is set to the integer value of 1, this command will
105 be called. It defaults to a compiled value set using the EXECFIXCMD
106 definition in the config.h file.
107 .IP "disk PATH"
108 .IP "disk PATH [ MINSPACE | MINPERCENT% ]"
110 Checks the named disks mounted at PATH for available disk space. If
111 the disk space is less than MINSPACE (kB) if specified or less than
112 MINPERCENT (%) if a % sign is specified, or DEFDISKMINIMUMSPACE (kB)
113 if not specified, the associated entry in the
114 EXTENSIBLEDOTMIB.DISKMIBNUM.1.ERRORFLAG MIB table will be set to (1) and
115 a descriptive error message will be returned to queries of
116 EXTENSIBLEDOTMIB.DISKMIBNUM.1.ERRORMSG.
117 .IP "load MAX1"
118 .IP "load MAX1 MAX5"
119 .IP "load MAX1 MAX5 MAX15"
121 Checks the load average of the machine and returns an error flag (1),
122 and an text-string error message
123 to queries of EXTENSIBLEDOTMIB.LOADAVEMIBNUM.1.ERRORFLAG and
124 EXTENSIBLEDOTMIB.LOADAVEMIBNUM.1.ERRORMSG (respectively) when the
125 1-minute, 5-minute, or 15-minute averages exceed the associated
126 maximum values. If any of the MAX1, MAX5, or MAX15 values are
127 unspecified, they default to a value of DEFMAXLOADAVE.
128 .IP "file FILE [MAXSIZE]"
129 Monitors file sizes and makes sure they don't grow beyond a certain
130 size (in kilobytes). MAXSIZE defaults to infinite if not specified,
131 and only monitors the size without reporting errors about it.
132 A maximum of 20 files can be monitored.
133 .SS "Errors"
135 Any errors in obtaining the above information are reported via the
136 EXTENSIBLEDOTMIB.ERRORMIBNUM.1.ERRORFLAG flag and the
137 EXTENSIBLEDOTMIB.ERRORMIBNUM.1.ERRORMSG text-string description.
138 .SH AGENTX SUB-AGENTS
139 To enable AgentX support in the SNMP master agent, put the following
140 line in your snmpd.conf file:
141 .IP "master agentx"
142 See README.agentx for further details.
143 .IP "AgentXSocket addr"
144 This defines the address the master agent listens at.
145 The default is /var/agentx/master. Another possibility is localhost:705
146 .IP "AgentXTimeout addr"
147 Defines the timeout period for an AgentX request.
148 Default is 1 second.
149 .IP "AgentXRetries addr"
150 Defines the number of retries for an AgentX request.
151 Default is 5 retries.
153 You can also put the following in your subagent.conf file (where
154 "subagent" is the name you used in your init_snmp("subagent") api call:
155 .IP "agentPingInterval NUM"
156 This makes the subagent try and reconnect every NUM seconds to the
157 master if it ever becomes (or starts) disconnected.
158 >>>>>>> 5.4.2.3
159 .SH SMUX SUB-AGENTS
160 To enable and SMUX based sub-agent, such as
161 .IR gated ,
162 use the
163 .I smuxpeer
164 configuration entry
165 .IP "smuxpeer OID PASS"
166 For
167 .I gated
168 a sensible entry might be
169 .I smuxpeer .1.3.6.1.4.1.4.1.3 secret
170 .SH DYNAMICALLY LOADABLE MODULES
171 If the agent is built with support for the UCD-DLMOD-MIB it is capable
172 of loading agent MIB modules dynamically at startup through
173 the \fIdlmod\fR directive and during runtime through use of the UCD-DLMOD-MIB.
174 The following directive loads the shared object module file PATH which
175 uses the module name prefix NAME.
176 .IP "dlmod NAME PATH"
178 .SH ACCESS CONTROL
179 .B snmpd
180 supports the View-Based Access Control Model (VACM) as defined in RFC
181 2575. To this end, it recognizes the following keywords in the
182 configuration file: \fIcom2sec\fR, \fIgroup\fR, \fIaccess\fR, and
183 \fIview\fR as well as some easier-to-use wrapper directives:
184 \fIrocommunity\fR, \fIrwcommunity\fR, \fIrouser\fR, \fIrwuser\fR. If
185 IPv6 support has been enabled, the \fIrocommunity6\fR and
186 \fIrwcommunity6\fR tokens will also be available. This section
187 defines how to configure the snmpd program to accept various types and
188 levels of access.
189 .IP "rouser USER [noauth|auth|priv] [OID]"
190 .IP "rwuser USER [noauth|auth|priv] [OID]"
191 Creates a SNMPv3 USM user in the VACM access configuration tables. It
192 is more efficient (and powerful) to use the combined \fIgroup\fR,
193 \fIaccess\fR, and \fIview\fR directives instead, but these wrapper
194 directives are much simpler.
196 The minimum level of authentication and privacy the user must use is
197 specified by the first token (which defaults to "auth"). The OID
198 parameter restricts access for that user to everything below the given
199 OID.
200 .IP "rocommunity COMMUNITY [SOURCE] [OID]"
201 .IP "rwcommunity COMMUNITY [SOURCE] [OID]"
202 These create read-only and read-write communities that can be used to
203 access the agent. They are a quick wrapper around the more complex
204 and powerful \fIcom2sec\fR, \fIgroup\fR, \fIaccess\fR, and \fIview\fR
205 directive lines. They are not as efficient either, as groups aren't
206 created so the tables are possibly larger. In other words: don't use
207 these if you have complex situations to set up. If your setup is
208 simple or you don't mind a small performance hit, use these
209 directives.
211 The format of the SOURCE is token is described in the \fIcom2sec\fR
212 directive section below. The OID token restricts access for that
213 community to everything below that given OID.
214 .IP "rocommunity6 COMMUNITY [SOURCE] [OID]"
215 .IP "rwcommunity6 COMMUNITY [SOURCE] [OID]"
216 They are the alternative directives to the \fIrocommunity\fR,
217 \fIrwcommunity\fR for the transport domain UDPIPv6. They are only
218 valid in specifing \fIUDPIPv6\fR as transport domain.
220 The format of the SOURCE is token is described in the \fIcom2sec6\fR
221 directive section below. The OID token restricts access for that
222 community to everything below that given OID.
223 .IP "com2sec NAME SOURCE COMMUNITY"
224 This directive specifies the mapping from a source/community pair to
225 a security name. SOURCE can be a hostname, a subnet, or the word
226 \fI"default"\fR.
227 A subnet can be specified as IP/MASK or IP/BITS.
228 The first source/community combination that matches the incoming packet
229 is selected.
230 .IP "com2sec6 NAME SOURCE COMMUNITY"
231 This directive is the IPv6 version of \fIcom2sec\fR.
232 A subnet can be specified as IPv6/IPv6MASK or IPv6/BITS.
233 It is only valid in specifing \fIUDPIPv6\fR as transport domain.
234 .IP "group NAME MODEL SECURITY"
235 This directive defines the mapping from securitymodel/securityname to group.
236 MODEL is one of \fIv1\fR, \fIv2c\fR, or \fIusm\fR.
237 .IP "access NAME CONTEXT MODEL LEVEL PREFX READ WRITE NOTIFY"
238 The access directive maps from group/security model/security level to
239 a view.
240 MODEL is one of \fIany\fR, \fIv1\fR, \fIv2c\fR, or \fIusm\fR.
241 LEVEL is one of \fInoauth\fR, \fIauth\fR, or \fIpriv\fR.
242 PREFX specifies how CONTEXT should be matched against the context of
243 the incoming pdu, either \fIexact\fR or \fIprefix\fR.
244 READ, WRITE and NOTIFY specifies the view to be used for the corresponding
245 access.
246 For v1 or v2c access, LEVEL will be noauth, and CONTEXT will be empty.
247 .IP "view NAME TYPE SUBTREE [MASK]"
248 This defines the named view. TYPE is either \fIincluded\fR or \fIexcluded\fR.
249 MASK is a list of hex octets, separated by '.' or ':'. The MASK
250 defaults to "ff" if not specified.
252 The reason for the mask is, that it allows you to control access to
253 one row in a table, in a relatively simple way. As an example, as an ISP
254 you might consider giving each customer access to his or her own interface:
257 view cust1 included interfaces.ifTable.ifEntry.ifIndex.1 ff.a0
258 view cust2 included interfaces.ifTable.ifEntry.ifIndex.2 ff.a0
260 (interfaces.ifTable.ifEntry.ifIndex.1 == .1.3.6.1.2.1.2.2.1.1.1,
261 ff.a0 == 11111111.10100000. which nicely covers up and including
262 the row index, but lets the user vary the field of the row)
263 .IP "VACM Examples:"
265 # sec.name source community
266 com2sec local localhost private
267 com2sec mynet 10.10.10.0/24 public
268 com2sec public default public
269 com2sec6 mynet fec0::/64 public
271 # sec.model sec.name
272 group mygroup v1 mynet
273 group mygroup v2c mynet
274 group mygroup usm mynet
275 group local v1 local
276 group local v2c local
277 group local usm local
278 group public v1 public
279 group public v2c public
280 group public usm public
282 # incl/excl subtree mask
283 view all included .1 80
284 view system included system fe
285 view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
287 # context sec.model sec.level prefix read write notify
288 access mygroup "" any noauth exact mib2 none none
289 access public "" any noauth exact system none none
290 access local "" any noauth exact all all all
291 .IP "Default VACM model"
292 The default configuration of the agent, as shipped, is functionally
293 equivalent to the following entries:
295 com2sec public default public
296 group public v1 public
297 group public v2c public
298 group public usm public
299 view all included .1
300 access public "" any noauth exact all none none
301 .SH SNMPv3 CONFIGURATION
303 .IP "engineID STRING"
304 The snmpd agent needs to be configured with an engineID to be able to
305 respond to SNMPv3 messages. With this configuration file line, the
306 engineID will be configured from STRING. The default value of the
307 engineID is configured with the first IP address found for the
308 hostname of the machine.
309 .IP "createUser username (MD5|SHA) authpassphrase [DES] [privpassphrase]"
311 MD5 and SHA are the authentication types to use, but you must have
312 built the package with openssl installed in order to use SHA. The
313 only privacy protocol currently supported is DES. If the privacy
314 passphrase is not specified, it is assumed to be the same as the
315 authentication passphrase. Note that the users created will be
316 useless unless they are also added to the VACM access control tables
317 described above.
319 Warning: the minimum pass phrase length is 8 characters.
321 SNMPv3 users can be created at runtime using the
322 .I snmpusm(1)
323 command.
325 Instead of figuring out how to use this directive and where to put it
326 (see below), just run "net-snmp-config --create-snmpv3-user" instead,
327 which will add one of these lines to the right place.
329 This directive should be placed into the
330 PERSISTENT_DIRECTORY/snmpd.conf file instead of the other normal
331 locations. The reason is that the information is read from the file
332 and then the line is removed (eliminating the storage of the master
333 password for that user) and replaced with the key that is derived from
334 it. This key is a localized key, so that if it is stolen it can not
335 be used to access other agents. If the password is stolen, however,
336 it can be.
338 .SH SETTING SYSTEM INFORMATION
339 .IP "syslocation STRING"
340 .IP "syscontact STRING"
341 .IP "sysname STRING"
342 Sets the system location, system contact or system name for the agent.
343 This information is reported in the 'system' group the mibII tree.
344 Ordinarily these objects (sysLocation.0, sysContact.0 and sysName.0)
345 are read-write. However, specifying the value for one of these
346 objects by giving the appropriate token makes the corresponding object
347 read-only, and attempts to set the value of the object will result in
348 a notWritable error response.
349 .IP "sysservices NUMBER"
350 Sets the value of the system.sysServices.0 object.
351 For a host, a good value is 72.
352 .IP "sysdescr STRING"
353 .IP "sysobjectid OID"
354 Sets the system description or object ID for the agent.
355 Although these values are not SNMP-writable, it is conceivable
356 that a network administrator may wish to configure them to something
357 other than the default values.
358 .IP "agentaddress [<transport-specifier>:]<transport-address>[,...]"
359 Makes the agent list on the specified comma-separated list of
360 listening addresses instead of the default behaviour, which is to
361 listen on UDP port 161 on all IPv4 interfaces. See the section
362 .B LISTENING ADDRESSES
363 in the
364 .I snmpd(8)
365 manual page for more information about the format of listening
366 addresses. For example, specifying
367 .I "agentaddress 161,tcp:161,localhost:9161"
368 will make the agent listen on UDP port 161 on all IPv4 interfaces, TCP
369 port 161 on all IPv4 interfaces and UDP port 9161 only on the interface
370 associated with the localhost address.
371 .IP "agentgroup groupid"
372 Change to this gid after opening port. The groupid may refer to a group
373 by name or a number if the group number starts with '#'. For example,
374 specifying
375 .I agentgroup snmp
376 will cause the agent to run as the snmp group or
377 .I agentgroup #10
378 will cause the agent to run as the group with groupid 10.
379 .IP "agentuser uid"
380 Change to this uid after opening port. The userid may refer to a user
381 by name or a number if the user number starts with '#'. For example,
382 specifying
383 .I agentuser snmp
384 will cause the agent to run as the snmp user or
385 .I agentuser #10
386 will cause the agent to run as the user with userid 10.
387 .IP "interface NAME TYPE SPEED"
388 For interfaces where the agent fails to guess correctly on the type and
389 speed, this directive can supply additional information.
390 TYPE is a type value as given in the IANAifType-MIB.
391 .IP "ignoredisk STRING"
392 When scanning for available disk devices the agent might block in trying
393 to open all possible disk devices. This might lead to a timeout when
394 walking the device tree. Sometimes the next walk will run without timeout,
395 sometimes it will timeout every time you try it.
397 If you experience such behaviour you might add this directive and give all
398 device names not to be checked (i.e. opened). You might have more than one
399 such directive in your configuration file stating all devices not to be
400 opened. You might also specify those devices using wildcards similar to
401 the syntax you can use in a bourne shell (see examples below).
403 .B Note:
404 For a list of devices scanned for every system please consult the sources
405 (host/hr_disk.c) and check for the Add_HR_Disk_entry() calls relevant for
406 your type of OS.
408 Examples:
410 ignoredisk /dev/rdsk/c0t2d0
412 This directive prevents the device /dev/rdsk/c0t2d0 from being scanned.
414 ignoredisk /dev/rdsk/c0t[!6]d0
416 This directive prevents all devices /dev/rdsk/c0tXd0 except .../c0t6d0
417 from being scanned. For most systems similar is the following directive:
419 ignoredisk /dev/rdsk/c0t[0-57-9a-f]d0
421 ignoredisk /dev/rdsk/c1*
423 This directive prevents all devices whose device names start with /dev/rdsk/c1
424 from being scanned.
426 ignoredisk /dev/rdsk/c?t0d0
428 This directive prevents all devices /dev/rdsk/cXt0d0 ('X' might be any char)
429 from being scanned.
431 You might use more than one such wildcard expression in any such directive.
432 .IP "storageUseNFS NUMBER"
433 Setting storageUseNFS to 1 causes all NFS and NFS-like file systems to be
434 marked as 'Network Disks' in the hrStorageTable. This is according to RFC 2790.
435 Not setting storageUseNFS or setting it to 2 causes NFS and NFS-like file
436 systems to be marked as 'Fixed Disks' as it has been in previous versions of
437 the ucd-snmp SNMP agent.
438 .IP "authtrapenable NUMBER"
439 Setting authtrapenable to 1 enables generation of authentication failure
440 traps. The default value is disabled(2). Ordinarily the corresponding
441 object (snmpEnableAuthenTraps.0) is read-write, but setting its value
442 via this token makes the object read-only, and attempts to set the
443 value of the object will result in a notWritable error response.
444 .IP "override OID TYPE VALUE"
445 This directive allows you to override a particular OID with a
446 different value (and possibly a different type of value).
447 .\" The -rw flag will allow snmp SETs to modify it's value as well.
448 An example:
450 override sysDescr.0 octet_str "my own sysDescr"
452 That line will set the sysDescr.0 value to "my own sysDescr" as well
453 as make it modifiable with SNMP SETs as well (which is actually
454 illegal according to the MIB specifications).
456 Note that care must be taken when using this. For example, if you try
457 to override a property of the 3rd interface in the ifTable with a new
458 value and later the numbering within the ifTable changes it's index
459 ordering you'll end up with problems and your modified value won't
460 appear in the right place in the table.
462 Valid TYPEs are: integer, uinteger, octet_str, bit_str, object_id,
463 counter, gauge, null. Note that setting an object to "null"
464 effectively delete's it as being accessible. No VALUE needs to be
465 given if the object type is null.
467 More types should be available in the future, as well as writable
468 object support.
469 .SH "SETTING UP TRAP AND/OR INFORM DESTINATIONS"
470 .IP "trapcommunity STRING"
471 This defines the default community string to be used when sending traps.
472 Note that this command must be used prior to any of the following three
473 commands that are intended use this community string.
474 .IP "trapsink HOST [COMMUNITY [PORT]]"
475 .IP "trap2sink HOST [COMMUNITY [PORT]]"
476 .IP "informsink HOST [COMMUNITY [PORT]]"
477 These commands define
478 the hosts to receive traps (and/or inform notifications). The
479 daemon sends a Cold Start trap when it starts up. If enabled, it also sends
480 traps on authentication failures. Multiple \fItrapsink\fR, \fItrap2sink\fR
481 and \fIinformsink\fR lines may be specified to specify multiple destinations.
482 Use \fItrap2sink\fR to send SNMPv2 traps and \fIinformsink\fR to send
483 inform notifications.
484 If COMMUNITY is not specified, the string from a preceding \fItrapcommunity\fR
485 directive will be used. If PORT is not specified, the well known SNMP trap
486 port (162) will be used.
487 .IP "trapsess [SNMPCMD_ARGS] HOST"
488 This is a more generic trap configuration token that allows any type
489 of trap destination to be specified with any version of SNMP. See the
490 .I snmpcmd(1)
491 manual page for further details on the arguments that can be passed as
492 .I "SNMPCMD ARGS".
493 In addition to the arguments listed there, the special argument
494 \fI-Ci\fR specifies that you want inform notifications to be used
495 instead of unacknowledged traps (this requires that you also specify a
496 version number of v2c or v3 as well).
497 .SH "PROXY SUPPORT"
498 .IP "proxy [-Cn CONTEXTNAME] [SNMPCMD ARGS] HOST OID [REMOTEOID]"
500 This token specifies that any incoming requests under OID should be
501 proxied on to another HOST instead. If a CONTEXTNAME is specified, it
502 assigns the proxied tree to a particular context name within the local
503 agent. This is the proper way to query multiple agents through a
504 single proxy. Assign each remote agent to a different context name.
505 Then you can use "snmpwalk -n contextname1" to walk one remote proxied
506 agent and "snmpwalk -n contextname2" to walk another, assuming you are
507 using SNMPv3 to talk to the proxy (snmpv1 and snmpv2c context mappings
508 aren't currently supported but might be in the future). Optionally,
509 relocate the local OID tree to the new location at the REMOTEOID. To
510 authenticate to HOST you should use the appropriate set of
511 .I "SNMPCMD ARGS."
512 See the
513 .I snmpcmd(1)
514 manual page for details.
516 Examples:
520 # assigns the entire mib tree on remotehost1 to the context of the
521 # same name:
522 proxy -Cn remotehost1 -v 1 -c public remotehost1 .1.3
523 # ditto, but for remotehost 2
524 proxy -Cn remotehost2 -v 1 -c public remotehost2 .1.3
525 # proxies only the ucdavis enterprises tree to the remote host using snmpv1
526 proxy -v 1 -c public remotehost .1.3.6.1.4.1.2021
527 # uses v3 to access remotehost and converts the remote .1.3.6.1.2.1.1
528 # oid to local .1.3.6.1.3.10 oid (another way to access mulitple hosts
529 # without using contexts)
530 proxy -v 3 -l noAuthNoPriv -u user remotehost .1.3.6.1.3.10 .1.3.6.1.2.1.1
531 .SH "PASS-THROUGH CONTROL"
532 .IP "pass MIBOID EXEC"
533 (If you're writing perl scripts, please see the embedded perl support
534 information later in this manual page). Passes entire control of
535 MIBOID to the EXEC program. The EXEC program is called in one of the
536 following three ways:
538 .IP "EXEC -g MIBOID"
539 .IP "EXEC -n MIBOID"
541 These call lines match to SNMP get and getnext requests. It is
542 expected that the EXEC program will take the arguments passed to it
543 and return the appropriate response through it's stdout.
545 The first line of stdout should be the MIB OID of the returning value.
546 The second line should be the TYPE of value returned, where TYPE is
547 one of the text strings:
548 .B string, integer, unsigned, objectid, timeticks, ipaddress, counter,
550 .B gauge.
551 The third line of stdout should be the VALUE corresponding with the
552 returned TYPE.
554 For instance, if a script was to return the value integer value "42"
555 when a request for .1.3.6.1.4.100 was requested, the script should
556 return the following 3 lines:
559 .1.3.6.1.4.100
561 integer
566 To indicate that the script is unable to comply with the request due
567 to an end-of-mib condition or an invalid request, simple exit and
568 return no output to stdout at all. An SNMP error will be generated
569 corresponding to the SNMP noSuchName response.
570 .IP "EXEC -s MIBOID TYPE VALUE"
571 .IP
572 For SNMP set requests, the above call method is used. The TYPE passed
573 to the EXEC program is one of the text strings:
574 .B integer, counter, gauge, timeticks, ipaddress, objid,
576 .B string,
577 indicating the type of value passed in the next argument.
579 Return nothing to stdout, and the set will assumed to have been
580 successful. Otherwise, return one of the following error strings to
581 signal an error:
582 .B not-writable,
584 .B wrong-type
585 and the appropriate error response will be generated instead.
587 .IP Note:
588 By default, the only community allowed to write (ie snmpset) to your
589 script will be the "private" community,or community #2 if defined
590 differently by the "community" token discussed above. Which
591 communities are allowed write access are controlled by the RWRITE
592 definition in the snmplib/snmp_impl.h source file.
596 Example (in snmpd.conf):
598 pass .1.3.6.1.4.1.2021.255 /path/to/local/passtest
600 .IP "pass_persist MIBOID EXEC"
601 Passes entire control of MIBOID to the EXEC program.
602 Similar to pass, but the EXEC program continues to run after the initial
603 request is answered.
605 Upon initialization, EXEC is passed the string "PING\\n" in stdin,
606 and it should respond by printing "PONG\\n" to stdout.
608 For get and getnext requests, EXEC program is passed two lines,
609 the command (get or getnext) and the MIB OID. It should return
610 three lines, the MIB OID, the TYPE of value returned,
611 the VALUE corresponding with the returned TYPE.
613 For example, if the value for .1.3.6.1.4.100 was requested, the following
614 2 lines would be passed in to stdin:
619 .1.3.6.1.4.100
622 To return the value, say, 42, the script would write to stdout:
625 .1.3.6.1.4.100
627 integer
632 To indicate that the script is unable to comply with the request due
633 to an end-of-mib condition or an invalid request, print "NONE\\n" to
634 stdout.
636 Example (in snmpd.conf):
638 pass_persist .1.3.6.1.4.1.2021.255 /path/to/local/pass_persisttest
640 .SH "EMBEDDED PERL SUPPORT"
642 Warning: though embedded perl is working, not much functionality has
643 been implemented yet and thus writing mib module pieces for the agent
644 within perl is not trivial at this point. It should get better in
645 future releases.
647 The net-snmp package has ability to call perl scripts directly inside
648 the agent through embedded perl technology (similar to mod_perl for
649 the apache web server). This must be turned on at compile time by
650 passing --enable-embedded-perl to the configure script when the
651 package is built. To see if your package was built with embedded
652 perl, run "net-snmp-config --configure-options" and see if that flag
653 was used.
655 If compiled in, it defines the following snmpd.conf configuration
656 directives:
657 .IP "disablePerl true"
658 This will turn off perl support entirely. If the embedded perl
659 support stops working due to a change in perl, etc, this will stop any
660 calls to the perl core.
662 .IP "perlInitFile FILE"
663 Use FILE as the initialization file. This file is normally
664 DATADIR/snmp/snmp_perl.pl but this token can override that default.
665 This file performs any in-perl initialization that is needed before
666 the rest of the perl directives (below) are called. It is sourced
667 once just before the first perl directive is parsed. See the default
668 file for an example of the initialization it performs.
669 .IP "perl EXPRESSION"
670 Calls perl to evaluate an expression. Normally you'd want to do
671 something like register a function to call when an OID is requested,
672 but you can really do anything perl related you want. For example:
675 perl print "hello world\\n";
678 is the most basic hello world example.
680 The init script by default initializes a $agent variable which
681 is a pointer to a NetSnmp::agent object through which you can register
682 callbacks when a section of the OID tree is hit:
686 perl use Data::Dumper;
687 perl sub myroutine { print "got called: ",Dumper(@_),"\\n"; }
688 perl $agent->register('mylink', '.1.3.6.1.8765', \\&myroutine);
692 Sourcing an external file:
696 perl 'do /path/to/file.pl';
700 No better examples exist at the moment, unfortunately. Look for
701 improved support in future releases. Comments on how this looks as an
702 architecture are certainly appreciated now.
703 .SH "DISMAN-EVENT-MIB SUPPORT (READ: SENDING TRAPS ON ERRORS)"
705 Warning: this implementation has not been extensively tested and is
706 additionally not known to be entirely complete. The concepts defined
707 here should function appropriately, however, but no promises are made
708 at this time.
710 If your agent was compiled with support for the DISMAN-EVENT-MIB (you
711 can enable this by running the net-snmp configure script with the
712 --with-mib-modules=disman/event-mib argument) you have support for
713 having the agent check its own data at regular intervals and to send
714 out traps when certain conditions occur. Traps are sent when
715 expressions are first noticed, not once per evaluation. Once a test
716 expression fires a trap, the test will have to fail again before a new
717 trap is sent. See the DISMAN-EVENT-MIB documentation for more
718 details. This can be configured either using the MIB tables themselves
719 or by using these special key words:
720 .IP "agentSecName NAME"
721 The DISMAN-EVENT-MIB support requires a valid user name for which to
722 scan your agent with. This can either be specified using the
723 agentSecName token or by explicitly list one on the "monitor" lines
724 described below using the -u switch. Either way, a "rouser" line (or
725 equivalent access control settings) must also be specified with the
726 same security name name. If you need an example, just do something
727 like this:
731 agentSecName internal
732 rouser internal
736 And everything below should work just fine.
737 .IP "monitor [OPTIONS] NAME EXPRESSION"
738 This token tells the agent to monitor itself for problems based on
739 EXPRESSION. Expression is a simple expression based on an oid, a
740 comparison operator (!=, ==, <, <=, >, >=) and an integer value (see
741 the examples below). NAME is merely an arbitrary name of your
742 choosing for administrative purposes only. OPTIONS include the
743 following possibilities:
745 .IP "-r FREQUENCY"
746 Monitors the given expression every FREQUENCY seconds. The default is
747 600 (10 minutes).
748 .IP "-u SECNAME"
749 Use the SECNAME security name for scanning the local host.
750 Specifically, this SECNAME must then be given access control rights
751 via something like the "rouser" snmpd.conf token for this expression
752 to be valid at all. If not specified, it uses the default security
753 name specified by the agentsecname snmpd.conf token. Either the -u
754 flag or a valid agentsecname token must be specified (and that name
755 must be given proper access control rights via a "rouser" token).
756 .IP "-o OID"
757 Specifies additional object values to be delivered with in the
758 resulting trap in addition to the normal trap objects. This is useful
759 for obtaining other columns in the table for the row that triggered
760 the expression. See the examples below for more details.
763 The following example configuration checks the hrSWRunPerfTable table
764 (listing running processes) for any process which is consuming > 10Mb
765 of memory. It performs this check every 600 seconds (the default).
766 For every process it finds exceeding the limit, it will end out
767 exactly one notification. In addition to the normal hrSWRunPerfMem
768 oid and value sent in the trap, the hrSWRunName object will also be
769 sent. Note that the hrSWRunName object actually occurs in a different
770 table, but since the indexes to the two tables are the same this works
771 out alright.
775 rouser me
776 monitor -u me -o sysUpTime.0 -o hrSWRunName "high process memory" hrSWRunPerfMem > 10000
780 The above line would produce a trap which, when formated by snmptrapd, would
781 look like:
785 2002-04-05 13:33:53 localhost.localdomain [udp:127.0.0.1:32931]:
786 sysUpTimeInstance = Timeticks: (1629) 0:00:16.29 snmpTrapOID.0 = OID: mteTriggerFired mteHotTrigger = high process memory mteHotTargetName = mteHotContextName = mteHotOID = OID: hrSWRunPerfMem.1968 mteHotValue = 28564 hrSWRunName.1968 = "xemacs"
790 This shows my xemacs process using 28Mb of resident memory. Which,
791 considering it's xemacs, is not that surprising.
792 .IP "defaultMonitors yes"
793 By default, the agent and the DISMAN-EVENT-MIB support do nothing
794 until configured. Typically people wish to watch a bunch of tables
795 within the UCD-SNMP-MIB which are designed specifically for reporting
796 problems. If the "defaultMonitors yes" line is put into the
797 snmpd.conf file (which must be accompanied by an appropriate
798 agentSecName line and a rouser line), the following monitoring
799 conditions will be installed:
803 monitor -o prNames -o prErrMessage "process table" prErrorFlag != 0
804 monitor -o memErrorName -o memSwapErrorMsg "memory" memSwapError != 0
805 monitor -o extNames -o extOutput "extTable" extResult != 0
806 monitor -o dskPath -o dskErrorMsg "dskTable" dskErrorFlag != 0
807 monitor -o laNames -o laErrMessage "laTable" laErrorFlag != 0
808 monitor -o fileName -o fileErrorMsg "fileTable" fileErrorFlag != 0
811 .SH "DEBUGGING AND OTHER EXTENSIBILITY NOTES"
812 If you're trying to figure out aspects of the various mib modules
813 (possibly some that you've added yourself), the following may help you
814 spit out some useful debugging information. First off, please read
815 the snmpd manual page on the -D flag. Then the following
816 configuration snmpd.conf token, combined with the -D flag, can produce
817 useful output:
818 .IP "injectHandler HANDLER modulename"
819 This will insert new handlers into the section of the mib tree
820 referenced by "modulename". The types of handlers available for
821 insertion are:
824 debug - Prints out lots of debugging information when -Dhelper:debug
825 is passed to the snmpd application.
826 read_only - Forces turning off write support for the given module.
827 serialize - If a module is failing to handle multiple requests
828 properly (using the new 5.0 module API), this will force
829 the module to only receive one request at a time.
830 bulk_to_next - If a module registers to handle getbulk support, but
831 for some reason is failing to implement it properly,
832 this module will convert all getbulk requests to
833 getnext requests before the final module receives it.
836 .IP "Figuring out module names"
837 To figure out which modules you can inject things into, snmpwalk the
838 nsModuleTable which will give you a list of all named modules
839 registered within the agent.
840 .SH "EXAMPLE CONFIGURATION FILE"
841 See the EXAMPLE.CONF file in the top level source directory for a more
842 detailed example of how the above information is used in real
843 examples.
844 .SH "RE-READING snmpd.conf AND snmpd.local.conf"
845 The Net-SNMP agent can be forced to re-read its configuration files.
846 It can be told to do so by one of two ways:
847 .IP 1.
848 An snmpset of integer(1) to UCD-SNMP-MIB::versionUpdateConfig.0
849 (.1.3.6.1.4.1.2021.100.11.0)
850 .IP 2.
851 A "kill -HUP" signal sent to the snmpd agent process.
852 .SH "FILES"
853 SYSCONFDIR/snmp/snmpd.conf
854 .SH "SEE ALSO"
855 snmpconf(1), snmpusm(1), snmp.conf(5), snmp_config(5), snmpd(8), EXAMPLE.conf, read_config(3).
856 .\" Local Variables:
857 .\" mode: nroff
858 .\" End: