1SNMPCMD(1) Net-SNMP SNMPCMD(1)
2
3
4
6 snmpcmd - options and behaviour common to most of the Net-SNMP command-
7 line tools
8
10 snmpcmd [OPTIONS] AGENT [PARAMETERS]
11
13 This manual page describes the common options for the SNMP commands:
14 snmpbulkget, snmpbulkwalk, snmpdelta, snmpget, snmpgetnext, snmpnet‐
15 stat, snmpset, snmpstatus, snmptable, snmptest, snmptrap, snmpdf, snm‐
16 pusm , snmpwalk . The command line applications use the SNMP protocol
17 to communicate with an SNMP capable network entity, an agent. Individ‐
18 ual applications typically (but not necessarily) take additional param‐
19 eters that are given after the agent specification. These parameters
20 are documented in the manual pages for each application.
21
23 In addition to the options described in this manual page, all of the
24 tokens described in the snmp.conf and other .conf manual pages can be
25 used on the command line of Net-SNMP applications as well by prefixing
26 them with "--". EG, specifying --dontLoadHostConfig=true on the com‐
27 mand line will turn off loading of the host specific configuration
28 files.
29
30 The snmp.conf file settings and the double-dash arguments over-ride the
31 single-dash arguments. So it's important to note that if single-dash
32 arguments aren't working because you have settings in the snmp.conf
33 file that conflict with them then you'll need to use the longer-form
34 double-dash arguments to successfully trump the snmp.conf file set‐
35 tings.
36
38 These options control how the Net-SNMP commands behave regardless of
39 what version of SNMP you are using. See further below for options that
40 control specific versions or sub-modules of the SNMP protocol.
41
42 -d Dump (in hexadecimal) the raw SNMP packets sent and received.
43
44 -D[TOKEN[,...]]
45 Turn on debugging output for the given TOKEN(s). Try ALL for
46 extremely verbose output.
47
48
49 -h, --help
50 Display a brief usage message and then exit.
51
52 -H Display a list of configuration file directives understood by
53 the command and then exit.
54
55 -I [brRhu]
56 Specifies input parsing options. See INPUT OPTIONS below.
57
58 -L [eEfFoOsS]
59 Specifies output logging options. See LOGGING OPTIONS below.
60
61 -m MIBLIST
62 Specifies a colon separated list of MIB modules (not files) to
63 load for this application. This overrides (or augments) the en‐
64 vironment variable MIBS, the snmp.conf directive mibs, and the
65 list of MIBs hardcoded into the Net-SNMP library.
66
67 If MIBLIST has a leading '-' or '+' character, then the MIB mod‐
68 ules listed are loaded in addition to the default list, coming
69 before or after this list respectively. Otherwise, the speci‐
70 fied MIBs are loaded instead of this default list.
71
72 The special keyword ALL is used to load all MIB modules in the
73 MIB directory search list. Every file whose name does not begin
74 with "." will be parsed as if it were a MIB file.
75
76 -M DIRLIST
77 Specifies a colon separated list of directories to search for
78 MIBs. This overrides (or augments) the environment variable
79 MIBDIRS, the snmp.conf directive mibdirs, and the default direc‐
80 tory hardcoded into the Net-SNMP library (/usr/share/snmp/mibs).
81
82 If DIRLIST has a leading '-' or '+' character, then the given
83 directories are added to the default list, being searched before
84 or after the directories on this list respectively. Otherwise,
85 the specified directories are searched instead of this default
86 list.
87
88 Note that the directories appearing later in the list have have
89 precedence over earlier ones. To avoid searching any MIB direc‐
90 tories, set the MIBDIRS environment variable to the empty string
91 ("").
92
93 Note that MIBs specified using the -m option or the mibs config‐
94 uration directive will be loaded from one of the directories
95 listed by the -M option (or equivalents). The mibfile directive
96 takes a full path to the specified MIB file, so this does not
97 need to be in the MIB directory search list.
98
99 -v 1 | 2c | 3
100 Specifies the protocol version to use: 1 (RFCs 1155-1157), 2c
101 (RFCs 1901-1908), or 3 (RFCs 2571-2574). The default is typi‐
102 cally version 3. Overrides the defVersion token in the
103 snmp.conf file. -O [abeEfnqQsStTuUvxX] Specifies output print‐
104 ing options. See OUTPUT OPTIONS below.
105
106 -P [cdeRuwW]
107 Specifies MIB parsing options. See MIB PARSING OPTIONS below.
108
109 -r retries
110 Specifies the number of retries to be used in the requests. The
111 default is 5.
112
113 -t timeout
114 Specifies the timeout in seconds between retries. The default is
115 1. Floating point numbers can be used to specify fractions of
116 seconds.
117
118 -V, --version
119 Display version information for the application and then exit.
120
121 -Yname="value"
122
123 --name="value"
124 Allows one to specify any token ("name") supported in the
125 snmp.conf file and sets its value to "value". Overrides the cor‐
126 responding token in the snmp.conf file. See snmp.conf(5) for the
127 full list of tokens.
128
129
130
132 The following options are generic to all forms of SNMPv3, regardless of
133 whether it's the original SNMPv3 with USM or the newer SNMPv3 over
134 (D)TLS support.
135
136
137 -l secLevel
138 Set the securityLevel used for SNMPv3 messages (noAuthNoPriv|au‐
139 thNoPriv|authPriv). Appropriate pass phrase(s) must provided
140 when using any level higher than noAuthNoPriv. Overrides the
141 defSecurityLevel token in the snmp.conf file.
142
143 -n contextName
144 Set the contextName used for SNMPv3 messages. The default con‐
145 textName is the empty string "". Overrides the defContext token
146 in the snmp.conf file.
147
148
150 These options pass transport-specific parameters to the TLS layer. If
151 you're using SNMP over TLS or DTLS you'll need to pass a combination of
152 these either through these command line options or through snmp.conf
153 configuration tokens.
154
155 A note about <certificate-specifier>s : Net-SNMP looks for X.509 cer‐
156 tificates in each of the normal SNMP configuration directory search
157 paths under a "tls" subdirectory. IE, it will look in ~/.snmp/tls and
158 in /usr/local/share/snmp/tls for certificates. The certificate compo‐
159 nents (eg, the public and private halves) are stored in sub-directories
160 underneath this root set of directories. See the net-snmp-cert tool
161 for help in importing, creating and managing Net-SNMP certificates.
162 <certificate-specifier>s can reference either a fingerprint of the cer‐
163 tificate to use (the net-snmp-cert tool can help you figure out the
164 certificates) or the filename's prefix can be used. For example, if
165 you had a "snmpd.crt" certificate file then you could simply refer to
166 the certificate via the "snmpd" specifier.
167
168 -T localCert=<certificate-specifier>
169 Indicates to the transport which key should be used to initiate
170 (D)TLS client connections. This would typically be a certifi‐
171 cate found using the certificate fingerprint, the application
172 name (eg snmpd, snmptrapd, perl, python) or genericized name
173 "snmpapp" if using one of the generic applications (snmpget, sn‐
174 mpwalk, etc). This can also be set using the localCert speci‐
175 fier in a snmp.conf configuration file.
176
177 -T peerCert=<certificate-specifier>
178 If you expect a particular certificate to be presented by the
179 other side then you can use this specifier to indicate the cer‐
180 tificate it should present. If it fails to present the expected
181 certificate the client will refuse to open the connection (be‐
182 cause doing otherwise could lead to man-in-the-middle attacks).
183 This can also be set using the peerCert specifier in a snmp.conf
184 configuration file.
185
186 -T trust_cert=<certificate-specifier>
187 If you have a trusted CA certificate you wish to anchor trust
188 with, you can use this flag to load a given certificate as a
189 trust anchor. A copy of the certificate must exist within the
190 Net-SNMP certificate storage system or this must point to a com‐
191 plete path name. Also see the "trustCert" snmp.conf configura‐
192 tion token.
193
194 -T their_hostname=<name>
195 If the server's presented certificate can be validating using a
196 trust anchor then their hostname will be checked to ensure their
197 presented hostname matches one that is expected (you don't want
198 to connect to goodhost.example.com and accept a certificate pre‐
199 sented by badhost.example.com do you?). This token can specify
200 the exact host name expected to be presented by the remote side,
201 either in a subjectAltName field or in the CommonName field of
202 the server's X.509 certificate.
203
205 These options are specific to using SNMPv3 with the original User-based
206 Security Model (USM).
207
208 -3[MmKk] 0xHEXKEY
209 Sets the keys to be used for SNMPv3 transactions. These options
210 allow you to set the master authentication and encryption keys
211 (-3m and -3M respectively) or set the localized authentication
212 and encryption keys (-3k and -3K respectively). SNMPv3 keys can
213 be either passed in by hand using these flags, or by the use of
214 keys generated from passwords using the -A and -X flags dis‐
215 cussed below. For further details on SNMPv3 and its usage of
216 keying information, see the Net-SNMP tutorial web site (
217 http://www.Net-SNMP.org/tutorial-5/commands/ ). Overrides the
218 defAuthMasterKey (-3m), defPrivMasterKey (-3M), defAuthLocal‐
219 izedKey (-3k) or defPrivLocalizedKey (-3K) tokens, respectively,
220 in the snmp.conf file, see snmp.conf(5).
221
222 -a authProtocol
223 Set the authentication protocol
224 (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) used for authenticated
225 SNMPv3 messages. Overrides the defAuthType token in the
226 snmp.conf file.
227
228 -A authPassword
229 Set the authentication pass phrase used for authenticated SNMPv3
230 messages. Overrides the defAuthPassphrase token in the
231 snmp.conf file. It is insecure to specify pass phrases on the
232 command line, see snmp.conf(5).
233
234 -e engineID
235 Set the authoritative (security) engineID used for SNMPv3 RE‐
236 QUEST messages, given as a hexadecimal string (optionally pre‐
237 fixed by "0x"). It is typically not necessary to specify this
238 engine ID, as it will usually be discovered automatically.
239
240 -E engineID
241 Set the context engineID used for SNMPv3 REQUEST messages scope‐
242 dPdu, given as a hexadecimal string. If not specified, this
243 will default to the authoritative engineID.
244
245 -u secName
246 Set the securityName used for authenticated SNMPv3 messages.
247 Overrides the defSecurityName token in the snmp.conf file.
248
249 -x privProtocol
250 Set the privacy protocol (AES) used for encrypted SNMPv3 mes‐
251 sages. Overrides the defPrivType token in the snmp.conf file.
252 This option is only valid if the Net-SNMP software was build to
253 use OpenSSL.
254
255 -X privPassword
256 Set the privacy pass phrase used for encrypted SNMPv3 messages.
257 Overrides the defPrivPassphrase token in the snmp.conf file. It
258 is insecure to specify pass phrases on the command line, see
259 snmp.conf(5).
260
261 -Z boots,time
262 Set the engineBoots and engineTime used for authenticated SNMPv3
263 messages. This will initialize the local notion of the agents
264 boots/time with an authenticated value stored in the LCD. It is
265 typically not necessary to specify this option, as these values
266 will usually be discovered automatically.
267
268
269
271 -c community
272 Set the community string for SNMPv1/v2c transactions. Overrides
273 the defCommunity token in the snmp.conf file.
274
275
277 The string AGENT in the SYNOPSIS above specifies the remote SNMP entity
278 with which to communicate. This specification takes the form:
279
280 [<transport-specifier>:]<transport-address>
281
282 At its simplest, the AGENT specification may consist of a hostname, or
283 an IPv4 address in the standard "dotted quad" notation. In this case,
284 communication will be attempted using UDP/IPv4 to port 161 of the given
285 host. Otherwise, the <transport-address> part of the specification is
286 parsed according to the following table:
287
288 <transport-specifier> <transport-address> format
289
290 udp hostname[:port] or IPv4-address[:port]
291
292 tcp hostname[:port] or IPv4-address[:port]
293
294 unix pathname
295
296 ipx [network]:node[/port]
297
298 aal5pvc or pvc [interface.][VPI.]VCI
299
300 udp6 or udpv6 or udpipv6 hostname[:port] or IPv6-address:port or
301 '['IPv6-address']'[:port]
302
303 tcp6 or tcpv6 or tcpipv6 hostname[:port] or IPv6-address:port or
304 '['IPv6-address']'[:port]
305
306 Note that <transport-specifier> strings are case-insensitive so that,
307 for example, "tcp" and "TCP" are equivalent. Here are some examples,
308 along with their interpretation:
309
310 hostname:161 perform query using UDP/IPv4 datagrams to host‐
311 name on port 161. The ":161" is redundant here
312 since that is the default SNMP port in any
313 case.
314
315 udp:hostname identical to the previous specification. The
316 "udp:" is redundant here since UDP/IPv4 is the
317 default transport.
318
319 TCP:hostname:1161 connect to hostname on port 1161 using TCP/IPv4
320 and perform query over that connection.
321 udp6:hostname:10161 perform the query using
322 UDP/IPv6 datagrams to port 10161 on hostname
323 (which will be looked up as an AAAA record).
324
325 UDP6:[fe80::2d0:b7ff:fe21:c6c0]
326 perform the query using UDP/IPv6 datagrams to
327 port 161 at address fe80::2d0:b7ff:fe21:c6c0.
328
329 tcpipv6:[::1]:1611 connect to port 1611 on the local host (::1 in
330 IPv6 parlance) using TCP/IPv6 and perform query
331 over that connection.
332
333 tls:hostname:10161
334
335 dtls:hostname:10161 Connects using SNMP over DTLS or TLS as docu‐
336 mented by the ISMS working group (RFCs not yet
337 published as of this date). This will require
338 (and automatically ensures) that the TSM secu‐
339 rity model is in use. You'll also need to set
340 up trust paths for the certificates presented
341 by the server (see above for descriptions of
342 this).
343
344 ssh:hostname:22 Connects using SNMP over SSH as documented by
345 the ISMS working group (RFCs not yet published
346 as of this date). This will require that the
347 TSM security model is in use (--defSecurity‐
348 Model=tsm).
349
350 ipx::00D0B7AAE308 perform query using IPX datagrams to node num‐
351 ber 00D0B7AAE308 on the default network, and
352 using the default IPX port of 36879 (900F hexa‐
353 decimal), as suggested in RFC 1906.
354
355 ipx:0AE43409:00D0B721C6C0/1161
356 perform query using IPX datagrams to port 1161
357 on node number 00D0B721C6C0 on network number
358 0AE43409.
359
360 unix:/tmp/local-agent connect to the Unix domain socket /tmp/lo‐
361 cal-agent, and perform the query over that con‐
362 nection.
363
364 /tmp/local-agent identical to the previous specification, since
365 the Unix domain is the default transport iff
366 the first character of the <transport-address>
367 is a '/'.
368
369 alias:myname perform a connection to the myname alias which
370 needs to be defined in the snmp.conf file using
371 a line like " alias myname udp:127.0.0.1:9161
372 ". Any type of transport definition can be
373 used as the alias expansion parameter. Aliases
374 are particularly useful for using repeated com‐
375 plex transport strings.
376
377 AAL5PVC:100 perform the query using AAL5 PDUs sent on the
378 permanent virtual circuit with VPI=0 and
379 VCI=100 (decimal) on the first ATM adapter in
380 the machine.
381
382 PVC:1.10.32 perform the query using AAL5 PDUs sent on the
383 permanent virtual circuit with VPI=10 (decimal)
384 and VCI=32 (decimal) on the second ATM adapter
385 in the machine. Note that "PVC" is a synonym
386 for "AAL5PVC".
387
388 Note that not all the transport domains listed above will always be
389 available; for instance, hosts with no IPv6 support will not be able to
390 use udp6 transport addresses, and attempts to do so will result in the
391 error "Unknown host". Likewise, since AAL5 PVC support is only cur‐
392 rently available on Linux, it will fail with the same error on other
393 platforms.
394
396 The Net-SNMP MIB parser mostly adheres to the Structure of Management
397 Information (SMI). As that specification has changed through time, and
398 in recognition of the (ahem) diversity in compliance expressed in MIB
399 files, additional options provide more flexibility in reading MIB
400 files.
401
402 -Pc Toggles whether ASN.1 comments should extend to the end of the
403 MIB source line. Strictly speaking, a second appearance of "--"
404 should terminate the comment, but this breaks some MIB files.
405 The default behaviour (to interpret comments correctly) can also
406 be set with the configuration token commentToEOL.
407
408 -Pd Disables the loading of MIB object DESCRIPTIONs when parsing MIB
409 files. This reduces the amount of memory used by the running
410 application.
411
412 -Pe Toggles whether to show errors encountered when parsing MIB
413 files. These include references to IMPORTed modules and MIB ob‐
414 jects that cannot be located in the MIB directory search list.
415 The default behaviour can also be set with the configuration to‐
416 ken showMibErrors.
417
418 -PR If the same MIB object (parent name and sub-identifier) appears
419 multiple times in the list of MIB definitions loaded, use the
420 last version to be read in. By default, the first version will
421 be used, and any duplicates discarded. This behaviour can also
422 be set with the configuration token mibReplaceWithLatest.
423
424 Such ordering is normally only relevant if there are two MIB
425 files with conflicting object definitions for the same OID (or
426 different revisions of the same basic MIB object).
427
428 -Pu Toggles whether to allow the underline character in MIB object
429 names and other symbols. Strictly speaking, this is not valid
430 SMI syntax, but some vendor MIB files define such names. The
431 default behaviour can also be set with the configuration token
432 mibAllowUnderline.
433
434 -Pw Show various warning messages in parsing MIB files and building
435 the overall OID tree. This can also be set with the configura‐
436 tion directive mibWarningLevel 1
437
438 -PW Show some additional warning messages, mostly relating to pars‐
439 ing individual MIB objects. This can also be set with the con‐
440 figuration directive mibWarningLevel 2
441
442
444 The format of the output from SNMP commands can be controlled using
445 various parameters of the -O flag. The effects of these sub-options
446 can be seen by comparison with the following default output (unless
447 otherwise specified):
448 $ snmpget -c public -v 1 localhost sysUpTime.0
449 SNMPv2-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
450
451
452 -Oa Display string values as ASCII strings (unless there is a DIS‐
453 PLAY-HINT defined for the corresponding MIB object). By de‐
454 fault, the library attempts to determine whether the value is a
455 printable or binary string, and displays it accordingly.
456
457 This option does not affect objects that do have a Display Hint.
458
459 -Ob Display table indexes numerically, rather than trying to inter‐
460 pret the instance subidentifiers as string or OID values:
461 $ snmpgetnext -c public -v 1 localhost vacmSecurityModel
462 SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0."wes" = xxx
463 $ snmpgetnext -c public -v 1 -Ob localhost vacmSecurityModel
464 SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0.3.119.101.115 = xxx
465
466 -Oe Removes the symbolic labels from enumeration values:
467 $ snmpget -c public -v 1 localhost ipForwarding.0
468 IP-MIB::ipForwarding.0 = INTEGER: forwarding(1)
469 $ snmpget -c public -v 1 -Oe localhost ipForwarding.0
470 IP-MIB::ipForwarding.0 = INTEGER: 1
471
472 -OE Modifies index strings to escape the quote characters:
473 $ snmpgetnext -c public -v 1 localhost vacmSecurityModel
474 SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0."wes" = xxx
475 $ snmpgetnext -c public -v 1 -OE localhost vacmSecurityModel
476 SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0.\"wes\" = xxx
477
478 This allows the output to be reused in shell commands.
479
480 -Of Include the full list of MIB objects when displaying an OID:
481 .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 =
482 Timeticks: (14096763) 1 day, 15:09:27.63
483
484 -On Displays the OID numerically:
485 .1.3.6.1.2.1.1.3.0 = Timeticks: (14096763) 1 day,
486 15:09:27.63
487
488 -Op PRECISION
489 Uses the PRECISION string to allow modification of the value
490 output format. This is used with OPAQUE float/double at the mo‐
491 ment, but might be usabe for other types in the future. Allowed
492 PRECISION strings are compatible to the flag/field with/preci‐
493 sion part of the printf(3) function:
494 $ snmpget localhost outputVoltage.1
495 WIENER-CRATE-MIB::outputVoltage.u0 = Opaque: Float: 0.000000
496 V
497 $ snmpget -Op +020.12 localhost outputVoltage.1
498 WIENER-CRATE-MIB::outputVoltage.u0 = Opaque: Float:
499 +000000.000000000000 V
500
501 -Oq Removes the equal sign and type information when displaying
502 varbind values:
503 SNMPv2-MIB::sysUpTime.0 1:15:09:27.63
504
505 -OQ Removes the type information when displaying varbind values:
506 SNMPv2-MIB::sysUpTime.0 = 1:15:09:27.63
507
508 -Os Display the MIB object name (plus any instance or other subiden‐
509 tifiers):
510 sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
511
512 -OS Display the name of the MIB, as well as the object name:
513 SNMPv2-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day,
514 15:09:27.63
515
516 This is the default OID output format.
517
518 -Ot Display TimeTicks values as raw numbers:
519 SNMPv2-MIB::sysUpTime.0 = 14096763
520
521 -OT If values are printed as Hex strings, display a printable ver‐
522 sion as well.
523
524 -Ou Display the OID in the traditional UCD-style (inherited from the
525 original CMU code). That means removing a series of "standard"
526 prefixes from the OID, and displaying the remaining list of MIB
527 object names (plus any other subidentifiers):
528 system.sysUpTime.0 = Timeticks: (14096763) 1 day,
529 15:09:27.63
530
531 -OU Do not print the UNITS suffix at the end of the value.
532
533 -Ov Display the varbind value only, not the OID:
534 $ snmpget -c public -v 1 -Ov localhost ipForwarding.0
535 INTEGER: forwarding(1)
536
537 -Ox Display string values as Hex strings (unless there is a DIS‐
538 PLAY-HINT defined for the corresponding MIB object). By de‐
539 fault, the library attempts to determine whether the value is a
540 printable or binary string, and displays it accordingly.
541
542 This option does not affect objects that do have a Display Hint.
543
544 -OX Display table indexes in a more "program like" output, imitating
545 a traditional array-style index format:
546 $ snmpgetnext -c public -v 1 localhost ipv6RouteTable
547 IPv6-MIB::ipv6RouteIfIndex.63.254.1.0.255.0.0.0.0.0.0.0.0.0.0.0.64.1 = INTEGER: 2
548 $ snmpgetnext -c public -v 1 -OX localhost ipv6RouteTable
549 IPv6-MIB::ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64][1] = INTEGER: 2
550
551 Most of these options can also be configured via configuration tokens.
552 See the snmp.conf(5) manual page for details.
553
554
556 The mechanism and destination to use for logging of warning and error
557 messages can be controlled by passing various parameters to the -L
558 flag.
559
560 -Ln Disable all logging.
561
562 -Le Log messages to the standard error stream.
563
564 -Lf FILE
565 Log messages to the specified file.
566
567 -Lo Log messages to the standard output stream.
568
569 -Ls FACILITY
570 Log messages via syslog, using the specified facility ('d' for
571 LOG_DAEMON, 'u' for LOG_USER, or '0'-'7' for LOG_LOCAL0 through
572 LOG_LOCAL7).
573
574 There are also "upper case" versions of each of these options, which
575 allow the corresponding logging mechanism to be restricted to certain
576 priorities of message. Using standard error logging as an example:
577
578 -LE pri
579 will log messages of priority 'pri' and above to standard error.
580 See below for possible 'pri' values-
581
582 -LE pri1-pri2
583 will log messages with priority between 'pri1' and 'pri2' (in‐
584 clusive) to standard error.
585
586 For -LF and -LS the priority specification comes before the file or fa‐
587 cility token.
588
589 The priorities recognised are:
590
591 0 or ! for LOG_EMERG,
592 1 or a for LOG_ALERT,
593 2 or c for LOG_CRIT,
594 3 or e for LOG_ERR,
595 4 or w for LOG_WARNING,
596 5 or n for LOG_NOTICE,
597 6 or i for LOG_INFO, and
598 7 or d for LOG_DEBUG.
599
600 Normal output is (or will be!) logged at a priority level of LOG_NOTICE
601
602
604 The interpretation of input object names and the values to be assigned
605 can be controlled using various parameters of the -I flag. The default
606 behaviour will be described at the end of this section.
607
608 -Ib specifies that the given name should be regarded as a regular
609 expression, to match (case-insensitively) against object names
610 in the MIB tree. The "best" match will be used - calculated as
611 the one that matches the closest to the beginning of the node
612 name and the highest in the tree. For example, the MIB object
613 vacmSecurityModel could be matched by the expression vacmsecuri‐
614 tymodel (full name, but different case), or vacm.*model (regexp
615 pattern).
616
617 Note that '.' is a special character in regular expression pat‐
618 terns, so the expression cannot specify instance subidentifiers
619 or more than one object name. A "best match" expression will
620 only be applied against single MIB object names. For example,
621 the expression sys*ontact.0 would not match the instance sysCon‐
622 tact.0 (although sys*ontact would match sysContact). Similarly,
623 specifying a MIB module name will not succeed (so SN‐
624 MPv2-MIB::sys.*ontact would not match either).
625
626 -Ih disables the use of DISPLAY-HINT information when assigning val‐
627 ues. This would then require providing the raw value:
628 snmpset ... HOST-RESOURCES-MIB::hrSystemDate.0
629 x "07 D2 0C 0A 02 04 06 08"
630 instead of a formatted version:
631 snmpset ... HOST-RESOURCES-MIB::hrSystemDate.0
632 = 2002-12-10,2:4:6.8
633
634 -Ir disables checking table indexes and the value to be assigned
635 against the relevant MIB definitions. This will (hopefully) re‐
636 sult in the remote agent reporting an invalid request, rather
637 than checking (and rejecting) this before it is sent to the re‐
638 mote agent.
639
640 Local checks are more efficient (and the diagnostics provided
641 also tend to be more precise), but disabling this behaviour is
642 particularly useful when testing the remote agent.
643
644 -IR enables "random access" lookup of MIB names. Rather than pro‐
645 viding a full OID path to the desired MIB object (or qualifying
646 this object with an explicit MIB module name), the MIB tree will
647 be searched for the matching object name. Thus .iso.org.dod.in‐
648 ternet.mib-2.system.sysDescr.0 (or SNMPv2-MIB::sysDescr.0) can
649 be specified simply as sysDescr.0.
650
651 Warning:
652 Since MIB object names are not globally unique, this ap‐
653 proach may return a different MIB object depending on
654 which MIB files have been loaded.
655
656 The MIB-MODULE::objectName syntax has the advantage of uniquely
657 identifying a particular MIB object, as well as being slightly
658 more efficient (and automatically loading the necessary MIB file
659 if necessary).
660
661 -Is SUFFIX
662 adds the specified suffix to each textual OID given on the com‐
663 mand line. This can be used to retrieve multiple objects from
664 the same row of a table, by specifying a common index value.
665
666 -IS PREFIX
667 adds the specified prefix to each textual OID given on the com‐
668 mand line. This can be used to specify an explicit MIB module
669 name for all objects being retrieved (or for incurably lazy typ‐
670 ists).
671
672 -Iu enables the traditional UCD-style approach to interpreting input
673 OIDs. This assumes that OIDs are rooted at the 'mib-2' point in
674 the tree (unless they start with an explicit '.' or include a
675 MIB module name). So the sysDescr instance above would be ref‐
676 erenced as system.sysDescr.0.
677
678
679 Object names specified with a leading '.' are always interpreted as
680 "fully qualified" OIDs, listing the sequence of MIB objects from the
681 root of the MIB tree. Such objects and those qualified by an explicit
682 MIB module name are unaffected by the -Ib, -IR and -Iu flags.
683
684 Otherwise, if none of the above input options are specified, the de‐
685 fault behaviour for a "relative" OID is to try and interpret it as an
686 (implicitly) fully qualified OID, then apply "random access" lookup
687 (-IR), followed by "best match" pattern matching (-Ib).
688
689
691 PREFIX The standard prefix for object identifiers (when using UCD-style
692 output). Defaults to .iso.org.dod.internet.mgmt.mib-2
693
694 MIBS The list of MIBs to load. Defaults to
695 SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:
696 SNMP-VACM-MIB.
697 Overridden by the -m option.
698
699 MIBDIRS
700 The list of directories to search for MIBs. Defaults to
701 /usr/share/snmp/mibs. Overridden by the -M option.
702
703
705 /etc/snmp/snmpd.conf
706 Agent configuration file. See snmpd.conf(5).
707
708 /etc/snmp/snmp.conf
709
710 ~/.snmp/snmp.conf
711 Application configuration files. See snmp.conf(5).
712
713
715 snmpget(1), snmpgetnext(1), snmpset(1), snmpbulkget(1), snmpbulk‐
716 walk(1), snmpwalk(1), snmptable(1), snmpnetstat(1), snmpdelta(1), sn‐
717 mptrap(1), snmpinform(1), snmpusm(1), snmpstatus(1), snmptest(1),
718 snmp.conf(5).
719
720
721
722
723V5.9.4.pre2 20 Jul 2010 SNMPCMD(1)