1SNMPCMD(1)                         Net-SNMP                         SNMPCMD(1)
2
3
4

NAME

6       snmpcmd - options and behaviour common to most of the Net-SNMP command-
7       line tools
8

SYNOPSIS

10       snmpcmd [OPTIONS] AGENT [PARAMETERS]
11

DESCRIPTION

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

COMMAND-LINE CONFIG OPTIONS

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

Generic Options

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  under‐
53              stood by 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
60              below.
61
62       -m MIBLIST
63              Specifies a colon separated  list  of  MIB  modules  (not
64              files)  to load for this application.  This overrides (or
65              augments) the environment variable  MIBS,  the  snmp.conf
66              directive  mibs,  and the list of MIBs hardcoded into the
67              Net-SNMP library.
68
69              If MIBLIST has a leading '-' or '+' character,  then  the
70              MIB  modules listed are loaded in addition to the default
71              list, coming before  or  after  this  list  respectively.
72              Otherwise,  the specified MIBs are loaded instead of this
73              default list.
74
75              The special keyword ALL is used to load all  MIB  modules
76              in  the MIB directory search list.  Every file whose name
77              does not begin with "." will be parsed as if  it  were  a
78              MIB file.
79
80       -M DIRLIST
81              Specifies a colon separated list of directories to search
82              for MIBs.  This overrides (or augments)  the  environment
83              variable  MIBDIRS,  the  snmp.conf directive mibdirs, and
84              the default directory hardcoded into the Net-SNMP library
85              (/usr/share/snmp/mibs).
86
87              If  DIRLIST  has a leading '-' or '+' character, then the
88              given directories are added to the  default  list,  being
89              searched  before  or  after  the directories on this list
90              respectively.  Otherwise, the specified  directories  are
91              searched instead of this default list.
92
93              Note  that  the  directories  appearing later in the list
94              have have precedence over earlier ones.  To avoid search‐
95              ing  any  MIB  directories,  set  the MIBDIRS environment
96              variable to the empty string ("").
97
98              Note that MIBs specified using the -m option or the  mibs
99              configuration  directive  will  be loaded from one of the
100              directories listed by the  -M  option  (or  equivalents).
101              The  mibfile directive takes a full path to the specified
102              MIB file, so this does not need to be in the  MIB  direc‐
103              tory search list.
104
105       -v 1 | 2c | 3
106              Specifies   the   protocol   version   to  use:  1  (RFCs
107              1155-1157), 2c (RFCs 1901-1908), or 3  (RFCs  2571-2574).
108              The  default  is  typically  version  3.   Overrides  the
109              defVersion token in the snmp.conf file.  -O [abeEfnqQsSt‐
110              TuUvxX]  Specifies  output  printing  options. See OUTPUT
111              OPTIONS below.
112
113       -P [cdeRuwW]
114              Specifies MIB parsing options.  See MIB  PARSING  OPTIONS
115              below.
116
117       -r retries
118              Specifies  the  number  of  retries  to  be  used  in the
119              requests. The default is 5.
120
121       -t timeout
122              Specifies the timeout in  seconds  between  retries.  The
123              default  is  1.   Floating  point  numbers can be used to
124              specify fractions of seconds.
125
126       -V, --version
127              Display version information for the application and  then
128              exit.
129
130       -Yname="value"
131
132       --name="value"
133              Allows one to specify any token ("name") supported in the
134              snmp.conf file and sets its value to  "value".  Overrides
135              the  corresponding  token  in  the  snmp.conf  file.  See
136              snmp.conf(5) for the full list of tokens.
137
138
139

SNMPv3 Options

141       The following options  are  generic  to  all  forms  of  SNMPv3,
142       regardless  of  whether it's the original SNMPv3 with USM or the
143       newer SNMPv3 over (D)TLS support.
144
145
146       -l secLevel
147              Set the securityLevel used for SNMPv3 messages (noAuthNo‐
148              Priv|authNoPriv|authPriv).   Appropriate  pass  phrase(s)
149              must provided when using any level higher than  noAuthNo‐
150              Priv.    Overrides  the  defSecurityLevel  token  in  the
151              snmp.conf file.
152
153       -n contextName
154              Set  the  contextName  used  for  SNMPv3  messages.   The
155              default  contextName  is  the empty string "".  Overrides
156              the defContext token in the snmp.conf file.
157
158

SNMPv3 over TLS Options

160       These options pass  transport-specific  parameters  to  the  TLS
161       layer.   If  you're  using  SNMP over TLS or DTLS you'll need to
162       pass a combination of these either through  these  command  line
163       options or through snmp.conf configuration tokens.
164
165       A note about <certificate-specifier>s : Net-SNMP looks for X.509
166       certificates in each of the normal SNMP configuration  directory
167       search  paths  under  a "tls" subdirectory.  IE, it will look in
168       ~/.snmp/tls and in /usr/local/share/snmp/tls  for  certificates.
169       The  certificate  components (eg, the public and private halves)
170       are stored in sub-directories underneath this root set of direc‐
171       tories.   See the net-snmp-cert tool for help in importing, cre‐
172       ating and managing Net-SNMP  certificates.   <certificate-speci‐
173       fier>s  can reference either a fingerprint of the certificate to
174       use (the net-snmp-cert tool can help you figure out the certifi‐
175       cates)  or  the  filename's prefix can be used.  For example, if
176       you had a "snmpd.crt" certificate file  then  you  could  simply
177       refer to the certificate via the "snmpd" specifier.
178
179       -T localCert=<certificate-specifier>
180              Indicates  to  the  transport which key should be used to
181              initiate (D)TLS client connections.  This would typically
182              be a certificate found using the certificate fingerprint,
183              the application name (eg snmpd, snmptrapd, perl,  python)
184              or genericized name "snmpapp" if using one of the generic
185              applications (snmpget, snmpwalk, etc).  This can also  be
186              set using the localCert specifier in a snmp.conf configu‐
187              ration file.
188
189       -T peerCert=<certificate-specifier>
190              If you expect a particular certificate to be presented by
191              the  other  side then you can use this specifier to indi‐
192              cate the certificate it should present.  If it  fails  to
193              present  the  expected certificate the client will refuse
194              to open the connection  (because  doing  otherwise  could
195              lead to man-in-the-middle attacks).  This can also be set
196              using the peerCert specifier in a snmp.conf configuration
197              file.
198
199       -T trust_cert=<certificate-specifier>
200              If  you  have a trusted CA certificate you wish to anchor
201              trust with, you can use this flag to load  a  given  cer‐
202              tificate  as  a  trust anchor.  A copy of the certificate
203              must exist within the Net-SNMP certificate storage system
204              or this must point to a complete path name.  Also see the
205              "trustCert" snmp.conf configuration token.
206
207       -T their_hostname=<name>
208              If the server's presented certificate can  be  validating
209              using  a trust anchor then their hostname will be checked
210              to ensure their presented hostname matches  one  that  is
211              expected  (you  don't  want  to connect to goodhost.exam‐
212              ple.com  and  accept  a  certificate  presented  by  bad‐
213              host.example.com  do  you?).   This token can specify the
214              exact host name expected to be presented  by  the  remote
215              side,  either in a subjectAltName field or in the Common‐
216              Name field of the server's X.509 certificate.
217

SNMPv3 with USM Options

219       These options are specific to using  SNMPv3  with  the  original
220       User-based Security Model (USM).
221
222       -3[MmKk]  0xHEXKEY
223              Sets  the keys to be used for SNMPv3 transactions.  These
224              options allow you to set the  master  authentication  and
225              encryption  keys  (-3m  and  -3M respectively) or set the
226              localized authentication and encryption keys (-3k and -3K
227              respectively).   SNMPv3  keys  can be either passed in by
228              hand using these flags, or by the use of  keys  generated
229              from passwords using the -A and -X flags discussed below.
230              For further details on SNMPv3 and  its  usage  of  keying
231              information,   see  the  Net-SNMP  tutorial  web  site  (
232              http://www.Net-SNMP.org/tutorial-5/commands/  ).    Over‐
233              rides the defAuthMasterKey (-3m), defPrivMasterKey (-3M),
234              defAuthLocalizedKey (-3k)  or  defPrivLocalizedKey  (-3K)
235              tokens,   respectively,   in   the  snmp.conf  file,  see
236              snmp.conf(5).
237
238       -a authProtocol
239              Set         the          authentication          protocol
240              (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224)     used    for
241              authenticated SNMPv3 messages. Overrides the  defAuthType
242              token in the snmp.conf file.
243
244       -A authPassword
245              Set the authentication pass phrase used for authenticated
246              SNMPv3 messages.  Overrides the  defAuthPassphrase  token
247              in  the  snmp.conf  file.  It is insecure to specify pass
248              phrases on the command line, see snmp.conf(5).
249
250       -e engineID
251              Set the authoritative (security) engineID used for SNMPv3
252              REQUEST  messages, given as a hexadecimal string (option‐
253              ally prefixed by "0x").  It is typically not necessary to
254              specify  this engine ID, as it will usually be discovered
255              automatically.
256
257       -E engineID
258              Set the context engineID used for SNMPv3 REQUEST messages
259              scopedPdu,  given as a hexadecimal string.  If not speci‐
260              fied, this will default to the authoritative engineID.
261
262       -u secName
263              Set the securityName used for authenticated  SNMPv3  mes‐
264              sages.    Overrides  the  defSecurityName  token  in  the
265              snmp.conf file.
266
267       -x privProtocol
268              Set the privacy protocol (DES or AES) used for  encrypted
269              SNMPv3  messages.  Overrides the defPrivType token in the
270              snmp.conf file. This option is only valid if the Net-SNMP
271              software was build to use OpenSSL.
272
273       -X privPassword
274              Set  the  privacy  pass  phrase used for encrypted SNMPv3
275              messages.  Overrides the defPrivPassphrase token  in  the
276              snmp.conf  file.   It is insecure to specify pass phrases
277              on the command line, see snmp.conf(5).
278
279       -Z boots,time
280              Set the engineBoots and engineTime used for authenticated
281              SNMPv3  messages.   This will initialize the local notion
282              of the agents  boots/time  with  an  authenticated  value
283              stored  in  the  LCD.   It  is typically not necessary to
284              specify this option, as these values will usually be dis‐
285              covered automatically.
286
287
288

SNMPv1 and SNMPv2c Options

290       -c community
291              Set  the  community  string  for SNMPv1/v2c transactions.
292              Overrides the defCommunity token in the snmp.conf file.
293
294

AGENT SPECIFICATION

296       The string AGENT in the SYNOPSIS above specifies the remote SNMP
297       entity  with which to communicate.  This specification takes the
298       form:
299
300              [<transport-specifier>:]<transport-address>
301
302       At its simplest, the AGENT specification may consist of a  host‐
303       name, or an IPv4 address in the standard "dotted quad" notation.
304       In this case, communication will be attempted using UDP/IPv4  to
305       port  161 of the given host.  Otherwise, the <transport-address>
306       part of the specification is parsed according to  the  following
307       table:
308
309           <transport-specifier>       <transport-address> format
310
311           udp                         hostname[:port]               or
312                                       IPv4-address[:port]
313
314           tcp                         hostname[:port]               or
315                                       IPv4-address[:port]
316
317           unix                        pathname
318
319           ipx                         [network]:node[/port]
320
321           aal5pvc or pvc              [interface.][VPI.]VCI
322
323           udp6 or udpv6 or udpipv6    hostname[:port]               or
324                                       IPv6-address:port or
325                                        '['IPv6-address']'[:port]
326
327           tcp6 or tcpv6 or tcpipv6    hostname[:port]               or
328                                       IPv6-address:port or
329                                        '['IPv6-address']'[:port]
330
331       Note  that <transport-specifier> strings are case-insensitive so
332       that, for example, "tcp" and "TCP"  are  equivalent.   Here  are
333       some examples, along with their interpretation:
334
335       hostname:161            perform  query  using UDP/IPv4 datagrams
336                               to hostname on port 161.  The ":161"  is
337                               redundant here since that is the default
338                               SNMP port in any case.
339
340       udp:hostname            identical to the previous specification.
341                               The   "udp:"  is  redundant  here  since
342                               UDP/IPv4 is the default transport.
343
344       TCP:hostname:1161       connect to hostname on port  1161  using
345                               TCP/IPv4  and  perform  query  over that
346                               connection.  udp6:hostname:10161 perform
347                               the  query  using  UDP/IPv6 datagrams to
348                               port 10161 on hostname  (which  will  be
349                               looked up as an AAAA record).
350
351       UDP6:[fe80::2d0:b7ff:fe21:c6c0]
352                               perform  the  query using UDP/IPv6 data‐
353                               grams   to   port   161    at    address
354                               fe80::2d0:b7ff:fe21:c6c0.
355
356       tcpipv6:[::1]:1611      connect  to  port 1611 on the local host
357                               (::1 in IPv6  parlance)  using  TCP/IPv6
358                               and perform query over that connection.
359
360       tls:hostname:10161
361
362       dtls:hostname:10161     Connects  using SNMP over DTLS or TLS as
363                               documented by  the  ISMS  working  group
364                               (RFCs  not  yet  published  as  of  this
365                               date).  This will require (and automati‐
366                               cally  ensures)  that  the  TSM security
367                               model is in use.  You'll  also  need  to
368                               set  up trust paths for the certificates
369                               presented by the server (see  above  for
370                               descriptions of this).
371
372       ssh:hostname:22         Connects  using  SNMP  over SSH as docu‐
373                               mented by the ISMS working  group  (RFCs
374                               not  yet  published  as  of  this date).
375                               This will require that the TSM  security
376                               model    is   in   use   (--defSecurity‐
377                               Model=tsm).
378
379       ipx::00D0B7AAE308       perform query  using  IPX  datagrams  to
380                               node  number 00D0B7AAE308 on the default
381                               network, and using the default IPX  port
382                               of  36879  (900F  hexadecimal),  as sug‐
383                               gested in RFC 1906.
384
385       ipx:0AE43409:00D0B721C6C0/1161
386                               perform query  using  IPX  datagrams  to
387                               port 1161 on node number 00D0B721C6C0 on
388                               network number 0AE43409.
389
390       unix:/tmp/local-agent   connect  to  the  Unix   domain   socket
391                               /tmp/local-agent,  and perform the query
392                               over that connection.
393
394       /tmp/local-agent        identical to the previous specification,
395                               since  the  Unix  domain  is the default
396                               transport iff the first character of the
397                               <transport-address> is a '/'.
398
399       alias:myname            perform a connection to the myname alias
400                               which  needs  to  be  defined   in   the
401                               snmp.conf file using a line like " alias
402                               myname udp:127.0.0.1:9161 ".   Any  type
403                               of  transport  definition can be used as
404                               the alias expansion parameter.   Aliases
405                               are   particularly   useful   for  using
406                               repeated complex transport strings.
407
408       AAL5PVC:100             perform the query using AAL5  PDUs  sent
409                               on  the  permanent  virtual circuit with
410                               VPI=0 and VCI=100 (decimal) on the first
411                               ATM adapter in the machine.
412
413       PVC:1.10.32             perform  the  query using AAL5 PDUs sent
414                               on the permanent  virtual  circuit  with
415                               VPI=10 (decimal) and VCI=32 (decimal) on
416                               the second ATM adapter in  the  machine.
417                               Note   that   "PVC"  is  a  synonym  for
418                               "AAL5PVC".
419
420       Note that not all the transport domains listed above will always
421       be  available; for instance, hosts with no IPv6 support will not
422       be able to use udp6 transport addresses, and attempts to  do  so
423       will  result  in the error "Unknown host".  Likewise, since AAL5
424       PVC support is only currently available on Linux, it  will  fail
425       with the same error on other platforms.
426

MIB PARSING OPTIONS

428       The  Net-SNMP MIB parser mostly adheres to the Structure of Man‐
429       agement Information (SMI).  As that  specification  has  changed
430       through time, and in recognition of the (ahem) diversity in com‐
431       pliance expressed in MIB files, additional options provide  more
432       flexibility in reading MIB files.
433
434       -Pc    Toggles  whether  ASN.1 comments should extend to the end
435              of the MIB source  line.   Strictly  speaking,  a  second
436              appearance of "--" should terminate the comment, but this
437              breaks some MIB files.  The default behaviour (to  inter‐
438              pret comments correctly) can also be set with the config‐
439              uration token commentToEOL.
440
441       -Pd    Disables the loading  of  MIB  object  DESCRIPTIONs  when
442              parsing  MIB  files.   This  reduces the amount of memory
443              used by the running application.
444
445       -Pe    Toggles whether to show errors encountered  when  parsing
446              MIB  files.  These include references to IMPORTed modules
447              and MIB objects that cannot be located in the MIB  direc‐
448              tory  search list.  The default behaviour can also be set
449              with the configuration token showMibErrors.
450
451       -PR    If the same MIB object (parent name  and  sub-identifier)
452              appears  multiple  times  in  the list of MIB definitions
453              loaded, use the last version to be read in.  By  default,
454              the  first  version will be used, and any duplicates dis‐
455              carded.  This behaviour can also be set with the configu‐
456              ration token mibReplaceWithLatest.
457
458              Such  ordering is normally only relevant if there are two
459              MIB files with conflicting  object  definitions  for  the
460              same  OID  (or  different revisions of the same basic MIB
461              object).
462
463       -Pu    Toggles whether to allow the underline character  in  MIB
464              object  names and other symbols.  Strictly speaking, this
465              is not valid SMI syntax, but some vendor MIB files define
466              such  names.   The default behaviour can also be set with
467              the configuration token mibAllowUnderline.
468
469       -Pw    Show various warning messages in parsing  MIB  files  and
470              building the overall OID tree.  This can also be set with
471              the configuration directive mibWarningLevel 1
472
473       -PW    Show some additional warning messages, mostly relating to
474              parsing  individual  MIB  objects.   This can also be set
475              with the configuration directive mibWarningLevel 2
476
477

OUTPUT OPTIONS

479       The format of the output from SNMP commands  can  be  controlled
480       using  various  parameters of the -O flag.  The effects of these
481       sub-options can be seen by comparison with the following default
482       output (unless otherwise specified):
483              $ snmpget -c public -v 1 localhost sysUpTime.0
484              SNMPv2-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
485
486
487       -Oa    Display string values as ASCII strings (unless there is a
488              DISPLAY-HINT defined for the corresponding  MIB  object).
489              By default, the library attempts to determine whether the
490              value is a printable or binary string,  and  displays  it
491              accordingly.
492
493              This  option  does not affect objects that do have a Dis‐
494              play Hint.
495
496       -Ob    Display table indexes numerically, rather than trying  to
497              interpret  the  instance  subidentifiers as string or OID
498              values:
499                  $ snmpgetnext -c public -v 1 localhost vacmSecurityModel
500                  SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0."wes" = xxx
501                  $ snmpgetnext -c public -v 1 -Ob localhost vacmSecurityModel
502                  SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0.3.119.101.115 = xxx
503
504       -Oe    Removes the symbolic labels from enumeration values:
505                  $ snmpget -c public -v 1 localhost ipForwarding.0
506                  IP-MIB::ipForwarding.0 = INTEGER: forwarding(1)
507                  $ snmpget -c public -v 1 -Oe localhost ipForwarding.0
508                  IP-MIB::ipForwarding.0 = INTEGER: 1
509
510       -OE    Modifies index strings to escape the quote characters:
511                  $ snmpgetnext -c public -v 1 localhost vacmSecurityModel
512                  SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0."wes" = xxx
513                  $ snmpgetnext -c public -v 1 -OE localhost vacmSecurityModel
514                  SNMP-VIEW-BASED-ACM-MIB::vacmSecurityModel.0.\"wes\" = xxx
515
516              This allows the output to be reused in shell commands.
517
518       -Of    Include the full list of MIB objects when  displaying  an
519              OID:
520                  .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 =
521                             Timeticks: (14096763) 1 day, 15:09:27.63
522
523       -On    Displays the OID numerically:
524                  .1.3.6.1.2.1.1.3.0  =  Timeticks:  (14096763)  1 day,
525              15:09:27.63
526
527       -Op PRECISION
528              Uses the PRECISION string to allow  modification  of  the
529              value output format.  This is used with OPAQUE float/dou‐
530              ble at the moment, but might be usabe for other types  in
531              the  future.  Allowed PRECISION strings are compatible to
532              the flag/field with/precision part of the printf(3) func‐
533              tion:
534                  $ snmpget localhost outputVoltage.1
535                  WIENER-CRATE-MIB::outputVoltage.u0  =  Opaque: Float:
536              0.000000 V
537                  $ snmpget -Op +020.12 localhost outputVoltage.1
538                  WIENER-CRATE-MIB::outputVoltage.u0 =  Opaque:  Float:
539              +000000.000000000000 V
540
541       -Oq    Removes the equal sign and type information when display‐
542              ing varbind values:
543                  SNMPv2-MIB::sysUpTime.0 1:15:09:27.63
544
545       -OQ    Removes the type information when displaying varbind val‐
546              ues:
547                  SNMPv2-MIB::sysUpTime.0 = 1:15:09:27.63
548
549       -Os    Display  the  MIB object name (plus any instance or other
550              subidentifiers):
551                  sysUpTime.0   =   Timeticks:   (14096763)   1    day,
552              15:09:27.63
553
554       -OS    Display the name of the MIB, as well as the object name:
555                  SNMPv2-MIB::sysUpTime.0  =  Timeticks:  (14096763)  1
556              day, 15:09:27.63
557
558              This is the default OID output format.
559
560       -Ot    Display TimeTicks values as raw numbers:
561                  SNMPv2-MIB::sysUpTime.0 = 14096763
562
563       -OT    If values are printed as Hex strings, display a printable
564              version as well.
565
566       -Ou    Display  the  OID in the traditional UCD-style (inherited
567              from the original  CMU  code).   That  means  removing  a
568              series  of "standard" prefixes from the OID, and display‐
569              ing the remaining list of  MIB  object  names  (plus  any
570              other subidentifiers):
571                  system.sysUpTime.0  =  Timeticks:  (14096763)  1 day,
572              15:09:27.63
573
574       -OU    Do not print the UNITS suffix at the end of the value.
575
576       -Ov    Display the varbind value only, not the OID:
577                  $ snmpget -c public -v 1 -Ov localhost ipForwarding.0
578                  INTEGER: forwarding(1)
579
580       -Ox    Display string values as Hex strings (unless there  is  a
581              DISPLAY-HINT  defined  for the corresponding MIB object).
582              By default, the library attempts to determine whether the
583              value  is  a  printable or binary string, and displays it
584              accordingly.
585
586              This option does not affect objects that do have  a  Dis‐
587              play Hint.
588
589       -OX    Display  table  indexes  in a more "program like" output,
590              imitating a traditional array-style index format:
591                  $ snmpgetnext -c public -v 1 localhost ipv6RouteTable
592                  IPv6-MIB::ipv6RouteIfIndex.63.254.1.0.255.0.0.0.0.0.0.0.0.0.0.0.64.1 = INTEGER: 2
593                  $ snmpgetnext -c public -v 1 -OX localhost ipv6RouteTable
594                  IPv6-MIB::ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64][1] = INTEGER: 2
595
596       Most of these options can also be configured  via  configuration
597       tokens.  See the snmp.conf(5) manual page for details.
598
599

LOGGING OPTIONS

601       The  mechanism and destination to use for logging of warning and
602       error messages can be controlled by passing  various  parameters
603       to the -L flag.
604
605       -Ln    Disable all logging.
606
607       -Le    Log messages to the standard error stream.
608
609       -Lf FILE
610              Log messages to the specified file.
611
612       -Lo    Log messages to the standard output stream.
613
614       -Ls FACILITY
615              Log  messages  via  syslog,  using the specified facility
616              ('d' for LOG_DAEMON, 'u' for  LOG_USER,  or  '0'-'7'  for
617              LOG_LOCAL0 through LOG_LOCAL7).
618
619       There  are  also "upper case" versions of each of these options,
620       which allow the corresponding logging mechanism to be restricted
621       to  certain priorities of message.  Using standard error logging
622       as an example:
623
624       -LE pri
625              will log messages of priority 'pri' and above to standard
626              error.  See below for possible 'pri' values-
627
628       -LE pri1-pri2
629              will log messages with priority between 'pri1' and 'pri2'
630              (inclusive) to standard error.
631
632       For -LF and -LS the priority specification comes before the file
633       or facility token.
634
635       The priorities recognised are:
636
637              0 or !  for LOG_EMERG,
638              1 or a for LOG_ALERT,
639              2 or c for LOG_CRIT,
640              3 or e for LOG_ERR,
641              4 or w for LOG_WARNING,
642              5 or n for LOG_NOTICE,
643              6 or i for LOG_INFO, and
644              7 or d for LOG_DEBUG.
645
646       Normal  output  is  (or  will be!) logged at a priority level of
647       LOG_NOTICE
648
649

INPUT OPTIONS

651       The interpretation of input object names and the  values  to  be
652       assigned  can  be  controlled using various parameters of the -I
653       flag.  The default behaviour will be described  at  the  end  of
654       this section.
655
656       -Ib    specifies  that  the  given  name should be regarded as a
657              regular expression, to match (case-insensitively) against
658              object  names  in the MIB tree.  The "best" match will be
659              used - calculated as the one that matches the closest  to
660              the  beginning  of  the  node name and the highest in the
661              tree.  For  example,  the  MIB  object  vacmSecurityModel
662              could  be  matched  by  the  expression vacmsecuritymodel
663              (full name, but different case), or  vacm.*model  (regexp
664              pattern).
665
666              Note  that  '.' is a special character in regular expres‐
667              sion patterns, so the expression cannot specify  instance
668              subidentifiers  or  more  than  one object name.  A "best
669              match" expression will only be applied against single MIB
670              object  names.   For example, the expression sys*ontact.0
671              would  not  match  the  instance  sysContact.0  (although
672              sys*ontact  would match sysContact).  Similarly, specify‐
673              ing  a   MIB   module   name   will   not   succeed   (so
674              SNMPv2-MIB::sys.*ontact would not match either).
675
676       -Ih    disables the use of DISPLAY-HINT information when assign‐
677              ing values.  This would then require  providing  the  raw
678              value:
679                  snmpset ... HOST-RESOURCES-MIB::hrSystemDate.0
680                                  x "07 D2 0C 0A 02 04 06 08"
681              instead of a formatted version:
682                  snmpset ... HOST-RESOURCES-MIB::hrSystemDate.0
683                                  = 2002-12-10,2:4:6.8
684
685       -Ir    disables  checking  table  indexes  and  the  value to be
686              assigned against the relevant MIB definitions.  This will
687              (hopefully)  result  in  the  remote  agent  reporting an
688              invalid request, rather  than  checking  (and  rejecting)
689              this before it is sent to the remote agent.
690
691              Local checks are more efficient (and the diagnostics pro‐
692              vided also tend to be more precise), but  disabling  this
693              behaviour  is particularly useful when testing the remote
694              agent.
695
696       -IR    enables "random access" lookup of MIB names.  Rather than
697              providing  a  full OID path to the desired MIB object (or
698              qualifying this object with an explicit MIB module name),
699              the  MIB  tree  will  be searched for the matching object
700              name.  Thus .iso.org.dod.internet.mib-2.system.sysDescr.0
701              (or  SNMPv2-MIB::sysDescr.0)  can  be specified simply as
702              sysDescr.0.
703
704              Warning:
705                     Since MIB object names are  not  globally  unique,
706                     this  approach  may  return a different MIB object
707                     depending on which MIB files have been loaded.
708
709              The MIB-MODULE::objectName syntax has  the  advantage  of
710              uniquely  identifying a particular MIB object, as well as
711              being slightly more efficient (and automatically  loading
712              the necessary MIB file if necessary).
713
714       -Is SUFFIX
715              adds  the  specified  suffix to each textual OID given on
716              the command line.  This can be used to retrieve  multiple
717              objects  from  the  same  row of a table, by specifying a
718              common index value.
719
720       -IS PREFIX
721              adds the specified prefix to each textual  OID  given  on
722              the  command  line.   This  can  be  used  to  specify an
723              explicit MIB module name for all objects being  retrieved
724              (or for incurably lazy typists).
725
726       -Iu    enables  the traditional UCD-style approach to interpret‐
727              ing input OIDs.  This assumes that OIDs are rooted at the
728              'mib-2'  point  in  the  tree  (unless they start with an
729              explicit '.' or include a MIB module name).  So the  sys‐
730              Descr instance above would be referenced as system.sysDe‐
731              scr.0.
732
733
734       Object names specified with a leading '.' are always interpreted
735       as  "fully  qualified" OIDs, listing the sequence of MIB objects
736       from the root of the MIB tree.  Such objects and those qualified
737       by  an  explicit  MIB module name are unaffected by the -Ib, -IR
738       and -Iu flags.
739
740       Otherwise, if none of the above input options are specified, the
741       default  behaviour  for a "relative" OID is to try and interpret
742       it as an (implicitly) fully qualified OID,  then  apply  "random
743       access"  lookup (-IR), followed by "best match" pattern matching
744       (-Ib).
745
746

ENVIRONMENT VARIABLES

748       PREFIX The standard prefix for object  identifiers  (when  using
749              UCD-style   output).    Defaults  to  .iso.org.dod.inter‐
750              net.mgmt.mib-2
751
752       MIBS   The list of MIBs to load. Defaults to
753              SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:
754              SNMP-VACM-MIB.
755              Overridden by the -m option.
756
757       MIBDIRS
758              The  list  of directories to search for MIBs. Defaults to
759              /usr/share/snmp/mibs.  Overridden by the -M option.
760
761

FILES

763       /etc/snmp/snmpd.conf
764              Agent configuration file. See snmpd.conf(5).
765
766       /etc/snmp/snmp.conf
767
768       ~/.snmp/snmp.conf
769              Application configuration files. See snmp.conf(5).
770
771

SEE ALSO

773       snmpget(1), snmpgetnext(1),  snmpset(1),  snmpbulkget(1),  snmp‐
774       bulkwalk(1),  snmpwalk(1),  snmptable(1),  snmpnetstat(1),  snm‐
775       pdelta(1),  snmptrap(1),  snmpinform(1),  snmpusm(1),   snmpsta‐
776       tus(1), snmptest(1), snmp.conf(5).
777
778
779
780
781V5.8                              20 Jul 2010                       SNMPCMD(1)
Impressum