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  of  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       Thes  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 (MD5  or  SHA)  used  for
240              authenticated  SNMPv3 messages. Overrides the defAuthType
241              token in the snmp.conf file.
242
243       -A authPassword
244              Set the authentication pass phrase used for authenticated
245              SNMPv3  messages.   Overrides the defAuthPassphrase token
246              in the snmp.conf file. It is  insecure  to  specify  pass
247              phrases on the command line, see snmp.conf(5).
248
249       -e engineID
250              Set the authoritative (security) engineID used for SNMPv3
251              REQUEST messages, given as a hexadecimal string  (option‐
252              ally prefixed by "0x").  It is typically not necessary to
253              specify this engine ID, as it will usually be  discovered
254              automatically.
255
256       -E engineID
257              Set the context engineID used for SNMPv3 REQUEST messages
258              scopedPdu, given as a hexadecimal string.  If not  speci‐
259              fied, this will default to the authoritative engineID.
260
261       -u secName
262              Set  the  securityName used for authenticated SNMPv3 mes‐
263              sages.   Overrides  the  defSecurityName  token  in   the
264              snmp.conf file.
265
266       -x privProtocol
267              Set  the privacy protocol (DES or AES) used for encrypted
268              SNMPv3 messages.  Overrides the defPrivType token in  the
269              snmp.conf file. This option is only valid if the Net-SNMP
270              software was build to use OpenSSL.
271
272       -X privPassword
273              Set the privacy pass phrase  used  for  encrypted  SNMPv3
274              messages.   Overrides  the defPrivPassphrase token in the
275              snmp.conf file.  It is insecure to specify  pass  phrases
276              on the command line, see snmp.conf(5).
277
278       -Z boots,time
279              Set the engineBoots and engineTime used for authenticated
280              SNMPv3 messages.  This will initialize the  local  notion
281              of  the  agents  boots/time  with  an authenticated value
282              stored in the LCD.  It  is  typically  not  necessary  to
283              specify this option, as these values will usually be dis‐
284              covered automatically.
285
286
287

SNMPv1 and SNMPv2c Options

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

AGENT SPECIFICATION

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

MIB PARSING OPTIONS

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

OUTPUT OPTIONS

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

LOGGING OPTIONS

586       The  mechanism and destination to use for logging of warning and
587       error messages can be controlled by passing  various  parameters
588       to the -L flag.
589
590       -Le    Log messages to the standard error stream.
591
592       -Lf FILE
593              Log messages to the specified file.
594
595       -Lo    Log messages to the standard output stream.
596
597       -Ls FACILITY
598              Log  messages  via  syslog,  using the specified facility
599              ('d' for LOG_DAEMON, 'u' for  LOG_USER,  or  '0'-'7'  for
600              LOG_LOCAL0 through LOG_LOCAL7).
601
602       There  are  also "upper case" versions of each of these options,
603       which allow the corresponding logging mechanism to be restricted
604       to  certain priorities of message.  Using standard error logging
605       as an example:
606
607       -LE pri
608              will log messages of priority 'pri' and above to standard
609              error.
610
611       -LE p1-p2
612              will  log  messages  with  priority between 'p1' and 'p2'
613              (inclusive) to standard error.
614
615       For -LF and -LS the priority specification comes before the file
616       or facility token.  The priorities recognised are:
617
618              0 or !  for LOG_EMERG,
619              1 or a for LOG_ALERT,
620              2 or c for LOG_CRIT,
621              3 or e for LOG_ERR,
622              4 or w for LOG_WARNING,
623              5 or n for LOG_NOTICE,
624              6 or i for LOG_INFO, and
625              7 or d for LOG_DEBUG.
626
627       Normal  output  is  (or  will be!) logged at a priority level of
628       LOG_NOTICE
629
630

INPUT OPTIONS

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

ENVIRONMENT VARIABLES

729       PREFIX The standard prefix for object  identifiers  (when  using
730              UCD-style   output).    Defaults  to  .iso.org.dod.inter‐
731              net.mgmt.mib-2
732
733       MIBS   The   list    of    MIBs    to    load.    Defaults    to
734              SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:SNMP-VACM-MIB.
735              Overridden by the -m option.
736
737       MIBDIRS
738              The list of directories to search for MIBs.  Defaults  to
739              /usr/share/snmp/mibs.  Overridden by the -M option.
740
741

FILES

743       /etc/snmp/snmpd.conf
744              Agent configuration file. See snmpd.conf(5).
745
746       /etc/snmp/snmp.conf
747
748       ~/.snmp/snmp.conf
749              Application configuration files. See snmp.conf(5).
750
751

SEE ALSO

753       snmpget(1),  snmpgetnext(1),  snmpset(1),  snmpbulkget(1), snmp‐
754       bulkwalk(1),  snmpwalk(1),  snmptable(1),  snmpnetstat(1),  snm‐
755       pdelta(1),   snmptrap(1),  snmpinform(1),  snmpusm(1),  snmpsta‐
756       tus(1), snmptest(1), snmp.conf(5).
757
758
759
760
761V5.7.2                            20 Jul 2010                       SNMPCMD(1)
Impressum