# phpman > man > snmpcmd(1)

[SNMPCMD(1)](https://www.chedong.com/phpMan.php/man/SNMPCMD/1/markdown)                                    Net-SNMP                                    [SNMPCMD(1)](https://www.chedong.com/phpMan.php/man/SNMPCMD/1/markdown)



## NAME
       snmpcmd - options and behaviour common to most of the Net-SNMP command-line tools

## SYNOPSIS
       **snmpcmd** [OPTIONS] AGENT [PARAMETERS]

## DESCRIPTION
       This  manual  page describes the common options for the SNMP commands: **snmpbulkget**, **snmpbulk**‐‐
       **walk**, **snmpdelta**, **snmpget**, **snmpgetnext**, **snmpnetstat**, **snmpset**, **snmpstatus**, **snmptable**, **snmptest**,
       **snmptrap**,   **snmpdf**, **snmpusm** , **snmpwalk** .  The command line applications use the SNMP protocol
       to communicate with an SNMP capable network entity, an agent.  Individual applications  typi‐
       cally  (but not necessarily) take additional parameters that are given after the agent speci‐
       fication.  These parameters are documented in the manual pages for each application.

## COMMAND-LINE CONFIG OPTIONS
       In addition to the options described in this manual page, all of the tokens described in  the
       _snmp.conf_  and  other .conf manual pages can be used on the command line of Net-SNMP applica‐
       tions as well by prefixing them with "--".  EG, specifying _--dontLoadHostConfig=true_  on  the
       command line will turn off loading of the host specific configuration files.

       The  snmp.conf  file  settings  and the double-dash arguments over-ride the single-dash argu‐
       ments.  So it's important to note that if single-dash arguments aren't  working  because  you
       have  settings  in  the  _snmp.conf_  file  that conflict with them then you'll need to use the
       longer-form double-dash arguments to successfully trump the _snmp.conf_ file settings.

### Generic Options
       These options control how the Net-SNMP commands behave regardless of what version of SNMP you
       are  using.   See  further below for options that control specific versions or sub-modules of
       the SNMP protocol.

### -d

### -D
              Turn on debugging output for the given _TOKEN_(s).  Try _ALL_ for extremely  verbose  out‐
              put.


### -h, --help
              Display a brief usage message and then exit.

### -H
              exit.

### -I
              Specifies input parsing options. See **INPUT** **OPTIONS** below.

### -L
              Specifies output logging options. See **LOGGING** **OPTIONS** below.

### -m
              Specifies a colon separated list of MIB modules (not files) to load for this  applica‐
              tion.   This  overrides (or augments) the environment variable MIBS, the _snmp.conf_ di‐
              rective _mibs_, and the list of MIBs hardcoded into the Net-SNMP library.

              If _MIBLIST_ has a leading '-' or '+' character, then the MIB modules listed are  loaded
              in  addition to the default list, coming before or after this list respectively.  Oth‐
              erwise, the specified MIBs are loaded _instead_ of this default list.

              The special keyword _ALL_ is used to load all MIB modules in the  MIB  directory  search
              list.   Every  file  whose name does not begin with "." will be parsed as if it were a
              MIB file.

### -M
              Specifies a colon separated list of directories to search for  MIBs.   This  overrides
              (or  augments)  the environment variable MIBDIRS, the _snmp.conf_ directive _mibdirs_, and
              the default directory hardcoded into the Net-SNMP library (/usr/share/snmp/mibs).

              If _DIRLIST_ has a leading '-' or '+' character, then the given directories are added to
              the  default list, being searched before or after the directories on this list respec‐
              tively.  Otherwise, the specified directories are searched  _instead_  of  this  default
              list.

              Note  that  the directories appearing later in the list have have precedence over ear‐
              lier ones.  To avoid searching any MIB directories, set the MIBDIRS environment  vari‐
              able to the empty string ("").

              Note  that MIBs specified using the -m option or the _mibs_ configuration directive will
              be loaded from one of the directories listed by the -M option (or  equivalents).   The
              _mibfile_  directive  takes a full path to the specified MIB file, so this does not need
              to be in the MIB directory search list.

### -v
              Specifies the protocol version to use: 1 (RFCs 1155-1157), 2c (RFCs 1901-1908),  or  3
              (RFCs 2571-2574).  The default is typically version 3.  Overrides the _defVersion_ token
              in the _snmp.conf_ file.  **-O** _[abeEfnqQsStTuUvxX]_ Specifies output printing options.  See
              **OUTPUT** **OPTIONS** below.

### -P
              Specifies MIB parsing options.  See **MIB** **PARSING** **OPTIONS** below.

### -r
              Specifies the number of retries to be used in the requests. The default is 5.

### -t
              Specifies  the  timeout  in seconds between retries. The default is 1.  Floating point
              numbers can be used to specify fractions of seconds.

### -V, --version
              Display version information for the application and then exit.

### -Y

       **--**_name_**="value"**
              Allows one to specify any token ("name") supported in the _snmp.conf_ file and sets  its
              value  to  "value".  Overrides  the  corresponding  token  in  the _snmp.conf_ file. See
              [_snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown)_ for the full list of tokens.



### SNMPv3 Options
       The following options are generic to all forms of SNMPv3,  regardless  of  whether  it's  the
       original SNMPv3 with USM or the newer SNMPv3 over (D)TLS support.


### -l
              Set  the  securityLevel  used  for SNMPv3 messages (noAuthNoPriv|authNoPriv|authPriv).
              Appropriate pass phrase(s) must provided when using any level  higher  than  noAuthNo‐
              Priv.  Overrides the _defSecurityLevel_ token in the _snmp.conf_ file.

### -n
              Set  the  contextName  used for SNMPv3 messages.  The default contextName is the empty
              string "".  Overrides the _defContext_ token in the _snmp.conf_ file.


### SNMPv3 over TLS Options
       These options pass transport-specific parameters to the TLS layer.  If you're using SNMP over
       TLS  or DTLS you'll need to pass a combination of these either through these command line op‐
       tions or through snmp.conf configuration tokens.

       A note about _<certificate-specifier>s_ _:_ Net-SNMP looks for X.509 certificates in each of  the
       normal  SNMP  configuration  directory  search paths under a "tls" subdirectory.  IE, it will
       look in ~/.snmp/tls and in /usr/local/share/snmp/tls for certificates.  The certificate  com‐
       ponents  (eg,  the  public  and private halves) are stored in sub-directories underneath this
       root set of directories.  See the net-snmp-cert tool for help in importing, creating and man‐
       aging  Net-SNMP certificates.  _<certificate-specifier>s_ can reference either a fingerprint of
       the certificate to use (the net-snmp-cert tool can help you figure out the  certificates)  or
       the  filename's  prefix  can be used.  For example, if you had a "snmpd.crt" certificate file
       then you could simply refer to the certificate via the "snmpd" specifier.

### -T localCert=<certificate-specifier>
              Indicates to the transport which key should be used to initiate (D)TLS client  connec‐
              tions.  This would typically be a certificate found using the certificate fingerprint,
              the application name (eg snmpd, snmptrapd, perl, python) or genericized name "snmpapp"
              if  using  one of the generic applications (snmpget, snmpwalk, etc).  This can also be
              set using the localCert specifier in a snmp.conf configuration file.

### -T peerCert=<certificate-specifier>
              If you expect a particular certificate to be presented by the other side then you  can
              use  this  specifier  to  indicate  the certificate it should present.  If it fails to
              present the expected certificate the client will refuse to open  the  connection  (be‐
              cause  doing otherwise could lead to man-in-the-middle attacks).  This can also be set
              using the peerCert specifier in a snmp.conf configuration file.

### -T
              If you have a trusted CA certificate you wish to anchor trust with, you can  use  this
              flag  to  load  a given certificate as a trust anchor.  A copy of the certificate must
              exist within the Net-SNMP certificate storage system or this must point to a  complete
              path name.  Also see the "trustCert" snmp.conf configuration token.

### -T
              If  the  server's  presented  certificate  can be validating using a trust anchor then
              their hostname will be checked to ensure their presented hostname matches one that  is
              expected  (you  don't want to connect to goodhost.example.com and accept a certificate
              presented by badhost.example.com do you?).  This token can specify the exact host name
              expected  to  be  presented by the remote side, either in a subjectAltName field or in
              the CommonName field of the server's X.509 certificate.

### SNMPv3 with USM Options
       These options are specific to using SNMPv3 with the original User-based Security Model (USM).

### -3[MmKk]  0xHEXKEY
              Sets the keys to be used for SNMPv3 transactions.  These options allow you to set  the
              master authentication and encryption keys (-3m and -3M respectively) or set the local‐
              ized authentication and encryption keys (-3k and -3K respectively).  SNMPv3  keys  can
              be  either  passed  in by hand using these flags, or by the use of keys generated from
              passwords using the -A and -X flags discussed below.  For further  details  on  SNMPv3
              and   its  usage  of  keying  information,  see  the  Net-SNMP  tutorial  web  site  (
              <http://www.Net-SNMP.org/tutorial-5/commands/> ).  Overrides the defAuthMasterKey (-3m),
              defPrivMasterKey (-3M), defAuthLocalizedKey (-3k) or defPrivLocalizedKey (-3K) tokens,
              respectively, in the _snmp.conf_ file, see [_snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown)._

### -a
              Set the authentication protocol (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) used for au‐
              thenticated SNMPv3 messages. Overrides the _defAuthType_ token in the _snmp.conf_ file.

### -A
              Set  the authentication pass phrase used for authenticated SNMPv3 messages.  Overrides
              the _defAuthPassphrase_ token in the _snmp.conf_ file. It  is  insecure  to  specify  pass
              phrases on the command line, see [_snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown)._

### -e
              Set the authoritative (security) engineID used for SNMPv3 REQUEST messages, given as a
              hexadecimal string (optionally prefixed by "0x").  It is typically  not  necessary  to
              specify this engine ID, as it will usually be discovered automatically.

### -E
              Set  the context engineID used for SNMPv3 REQUEST messages scopedPdu, given as a hexa‐
              decimal string.  If not specified, this will default to the authoritative engineID.

### -u
              Set the securityName used for authenticated SNMPv3 messages.  Overrides the _defSecuri__‐
              _tyName_ token in the _snmp.conf_ file.

### -x
              Set  the  privacy protocol (DES or AES) used for encrypted SNMPv3 messages.  Overrides
              the _defPrivType_ token in the _snmp.conf_ file. This option is only valid if the Net-SNMP
              software was build to use OpenSSL.

### -X
              Set  the  privacy  pass phrase used for encrypted SNMPv3 messages.  Overrides the _def__‐
              _PrivPassphrase_ token in the _snmp.conf_ file.  It is insecure to specify pass phrases on
              the command line, see [_snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown)._

### -Z
              Set  the engineBoots and engineTime used for authenticated SNMPv3 messages.  This will
              initialize the local notion of the  agents  boots/time  with  an  authenticated  value
              stored  in  the  LCD.   It is typically not necessary to specify this option, as these
              values will usually be discovered automatically.



### SNMPv1 and SNMPv2c Options
### -c
              Set the community string for SNMPv1/v2c transactions.  Overrides the _defCommunity_  to‐
              ken in the _snmp.conf_ file.


## AGENT SPECIFICATION
       The  string _AGENT_ in the **SYNOPSIS** above specifies the remote SNMP entity with which to commu‐
       nicate.  This specification takes the form:

              [<transport-specifier>:]<transport-address>

       At its simplest, the _AGENT_ specification may consist of a hostname, or an IPv4 address in the
       standard  "dotted  quad"  notation.   In  this  case,  communication  will be attempted using
       UDP/IPv4 to port 161 of the given host.  Otherwise, the <transport-address> part of the spec‐
       ification is parsed according to the following table:

           **<transport-specifier>**       **<transport-address>** **format**

           udp                         hostname[:port] _or_ IPv4-address[:port]

           tcp                         hostname[:port] _or_ IPv4-address[:port]

           unix                        pathname

           ipx                         [network]:node[/port]

           aal5pvc _or_ pvc              [interface.][VPI.]VCI

           udp6 or udpv6 or udpipv6    hostname[:port] _or_ IPv6-address:port _or_
                                        '['IPv6-address']'[:port]

           tcp6 or tcpv6 or tcpipv6    hostname[:port] _or_ IPv6-address:port _or_
                                        '['IPv6-address']'[:port]

       Note  that <transport-specifier> strings are case-insensitive so that, for example, "tcp" and
       "TCP" are equivalent.  Here are some examples, along with their interpretation:

       _hostname:161_            perform query using UDP/IPv4 datagrams to _hostname_ on port _161_.   The
                               ":161"  is  redundant here since that is the default SNMP port in any
                               case.

       _udp:hostname_            identical to the previous specification.   The  "udp:"  is  redundant
                               here since UDP/IPv4 is the default transport.

       _TCP:hostname:1161_       connect  to  _hostname_  on  port _1161_ using TCP/IPv4 and perform query
                               over that connection.  _udp6:hostname:10161_ perform  the  query  using
                               UDP/IPv6 datagrams to port _10161_ on _hostname_ (which will be looked up
                               as an AAAA record).

       _UDP6:[[fe80::2d0](https://www.chedong.com/phpMan.php/perldoc/fe80%3A%3A2d0/markdown):b7ff:fe21:c6c0]_
                               perform the query using UDP/IPv6 datagrams to  port  161  at  address
                               [_fe80::2d0](https://www.chedong.com/phpMan.php/perldoc/fe80%3A%3A2d0/markdown):b7ff:fe21:c6c0_.

       _tcpipv6:[::1]:1611_      connect  to  port 1611 on the local host ([_::1_](https://www.chedong.com/phpMan.php/perldoc/%3A%3A1/markdown) in IPv6 parlance) using
                               TCP/IPv6 and perform query over that connection.

       _tls:hostname:10161_

       _dtls:hostname:10161_     Connects using SNMP over DTLS or TLS as documented by the ISMS  work‐
                               ing  group  (RFCs  not yet published as of this date).  This will re‐
                               quire (and automatically ensures) that the TSM security model  is  in
                               use.   You'll  also  need  to set up trust paths for the certificates
                               presented by the server (see above for descriptions of this).

       _ssh:hostname:22_         Connects using SNMP over SSH as documented by the ISMS working  group
                               (RFCs not yet published as of this date).  This will require that the
                               TSM security model is in use (--defSecurityModel=tsm).

       [_ipx::00D0B7AAE308_](https://www.chedong.com/phpMan.php/perldoc/ipx%3A%3A00D0B7AAE308/markdown)       perform query using IPX datagrams to node number _00D0B7AAE308_ on  the
                               default  network, and using the default IPX port of 36879 (900F hexa‐
                               decimal), as suggested in RFC 1906.

       _ipx:0AE43409:00D0B721C6C0/1161_
                               perform query using  IPX  datagrams  to  port  _1161_  on  node  number
                               _00D0B721C6C0_ on network number _0AE43409_.

       _unix:/tmp/local-agent_   connect  to  the Unix domain socket _/tmp/local-agent_, and perform the
                               query over that connection.

       _/tmp/local-agent_        identical to the previous specification, since the Unix domain is the
                               default  transport iff the first character of the <transport-address>
                               is a '/'.

       _alias:myname_            perform a connection to the _myname_ alias which needs to be defined in
                               the   snmp.conf   file   using   a   line   like   "   _alias_   _myname_
                               _udp:127.0.0.1:9161_ ".  Any type of transport definition can  be  used
                               as  the  alias  expansion parameter.  Aliases are particularly useful
                               for using repeated complex transport strings.

       _AAL5PVC:100_             perform the query using AAL5 PDUs sent on the permanent virtual  cir‐
                               cuit with VPI=0 and VCI=100 (decimal) on the first ATM adapter in the
                               machine.

       _PVC:1.10.32_             perform the query using AAL5 PDUs sent on the permanent virtual  cir‐
                               cuit  with  VPI=10  (decimal)  and VCI=32 (decimal) on the second ATM
                               adapter in the machine.  Note that "PVC" is a synonym for "AAL5PVC".

       Note that not all the transport domains listed above will always be available; for  instance,
       hosts  with no IPv6 support will not be able to use udp6 transport addresses, and attempts to
       do so will result in the error "Unknown host".  Likewise, since AAL5 PVC support is only cur‐
       rently available on Linux, it will fail with the same error on other platforms.

## MIB PARSING OPTIONS
       The  Net-SNMP MIB parser mostly adheres to the Structure of Management Information (SMI).  As
       that specification has changed through time, and in recognition of the  (ahem)  diversity  in
       compliance expressed in MIB files, additional options provide more flexibility in reading MIB
       files.

### -Pc
              Strictly  speaking, a second appearance of "--" should terminate the comment, but this
              breaks some MIB files.  The default behaviour (to interpret  comments  correctly)  can
              also be set with the configuration token _commentToEOL_.

### -Pd
              the amount of memory used by the running application.

### -Pe
              erences  to  IMPORTed modules and MIB objects that cannot be located in the MIB direc‐
              tory search list.  The default behaviour can also be set with the configuration  token
              _showMibErrors_.

### -PR
              list of MIB definitions loaded, use the last version to be read in.  By  default,  the
              first  version will be used, and any duplicates discarded.  This behaviour can also be
              set with the configuration token _mibReplaceWithLatest_.

              Such ordering is normally only relevant if there are two MIB  files  with  conflicting
              object  definitions for the same OID (or different revisions of the same basic MIB ob‐
              ject).

### -Pu
              bols.   Strictly speaking, this is not valid SMI syntax, but some vendor MIB files de‐
              fine such names.  The default behaviour can also be set with the  configuration  token
              _mibAllowUnderline_.

### -Pw
              This can also be set with the configuration directive _mibWarningLevel_ _1_

### -PW
              jects.  This can also be set with the configuration directive _mibWarningLevel_ _2_


## OUTPUT OPTIONS
       The format of the output from SNMP commands can be controlled using various parameters of the
### -O
       fault output (unless otherwise specified):
              $ snmpget -c public -v 1 localhost sysUpTime.0
              SNMPv2-[MIB::sysUpTime](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AsysUpTime/markdown).0 = Timeticks: (14096763) 1 day, 15:09:27.63


### -Oa
              corresponding MIB object).  By default, the library attempts to determine whether  the
              value is a printable or binary string, and displays it accordingly.

              This option does not affect objects that _do_ have a Display Hint.

### -Ob
              subidentifiers as string or OID values:
                  $ snmpgetnext -c public -v 1 localhost vacmSecurityModel
                  SNMP-VIEW-BASED-ACM-[MIB::vacmSecurityModel](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AvacmSecurityModel/markdown).0."wes" = xxx
                  $ snmpgetnext -c public -v 1 **-Ob** localhost vacmSecurityModel
                  SNMP-VIEW-BASED-ACM-[MIB::vacmSecurityModel](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AvacmSecurityModel/markdown).0.3.119.101.115 = xxx

### -Oe
                  $ snmpget -c public -v 1 localhost ipForwarding.0
                  IP-[MIB::ipForwarding](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AipForwarding/markdown).0 = INTEGER: [forwarding(1)](https://www.chedong.com/phpMan.php/man/forwarding/1/markdown)
                  $ snmpget -c public -v 1 **-Oe** localhost ipForwarding.0
                  IP-[MIB::ipForwarding](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AipForwarding/markdown).0 = INTEGER: 1

### -OE
                  $ snmpgetnext -c public -v 1 localhost vacmSecurityModel
                  SNMP-VIEW-BASED-ACM-[MIB::vacmSecurityModel](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AvacmSecurityModel/markdown).0."wes" = xxx
                  $ snmpgetnext -c public -v 1 **-OE** localhost vacmSecurityModel
                  SNMP-VIEW-BASED-ACM-[MIB::vacmSecurityModel](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AvacmSecurityModel/markdown).0.\"wes\" = xxx

              This allows the output to be reused in shell commands.

### -Of
                  .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 =
                             Timeticks: (14096763) 1 day, 15:09:27.63

### -On
                  .1.3.6.1.2.1.1.3.0 = Timeticks: (14096763) 1 day, 15:09:27.63

### -Op PRECISION
              Uses the PRECISION string to allow modification of the value output format.   This  is
              used with OPAQUE float/double at the moment, but might be usabe for other types in the
              future. Allowed PRECISION strings are compatible to the flag/field with/precision part
              of the [printf(3)](https://www.chedong.com/phpMan.php/man/printf/3/markdown) function:
                  $ snmpget localhost outputVoltage.1
                  WIENER-CRATE-[MIB::outputVoltage](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AoutputVoltage/markdown).u0 = Opaque: Float: 0.000000 V
                  $ snmpget -Op +020.12 localhost outputVoltage.1
                  WIENER-CRATE-[MIB::outputVoltage](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AoutputVoltage/markdown).u0 = Opaque: Float: +000000.000000000000 V

### -Oq
                  SNMPv2-[MIB::sysUpTime](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AsysUpTime/markdown).0 1:15:09:27.63

### -OQ
                  SNMPv2-[MIB::sysUpTime](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AsysUpTime/markdown).0 = 1:15:09:27.63

### -Os
                  sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63

### -OS
                  SNMPv2-[MIB::sysUpTime](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AsysUpTime/markdown).0 = Timeticks: (14096763) 1 day, 15:09:27.63

              This is the default OID output format.

### -Ot
                  SNMPv2-[MIB::sysUpTime](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AsysUpTime/markdown).0 = 14096763

### -OT

### -Ou
              That means removing a series of "standard" prefixes from the OID, and  displaying  the
              remaining list of MIB object names (plus any other subidentifiers):
                  system.sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63

### -OU

### -Ov
                  $ snmpget -c public -v 1 **-Ov** localhost ipForwarding.0
                  INTEGER: [forwarding(1)](https://www.chedong.com/phpMan.php/man/forwarding/1/markdown)

### -Ox
              corresponding MIB object).  By default, the library attempts to determine whether  the
              value is a printable or binary string, and displays it accordingly.

              This option does not affect objects that _do_ have a Display Hint.

### -OX
              style index format:
                  $ snmpgetnext -c public -v 1 localhost ipv6RouteTable
                  IPv6-[MIB::ipv6RouteIfIndex](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3Aipv6RouteIfIndex/markdown).63.254.1.0.255.0.0.0.0.0.0.0.0.0.0.0.64.1 = INTEGER: 2
                  $ snmpgetnext -c public -v 1 **-OX** localhost ipv6RouteTable
                  IPv6-[MIB::ipv6RouteIfIndex](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3Aipv6RouteIfIndex/markdown)[3ffe:100:ff00:0:0:0:0:0][64][1] = INTEGER: 2

       Most of these options can also be configured via configuration tokens.  See the  [_snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown)_
       manual page for details.


## LOGGING OPTIONS
       The  mechanism  and  destination to use for logging of warning and error messages can be con‐
       trolled by passing various parameters to the **-L** flag.

### -Ln

### -Le

### -Lf FILE
              Log messages to the specified file.

### -Lo

### -Ls FACILITY
              Log messages via syslog, using the specified facility ('d'  for  LOG_DAEMON,  'u'  for
              LOG_USER, or '0'-'7' for LOG_LOCAL0 through LOG_LOCAL7).

       There  are also "upper case" versions of each of these options, which allow the corresponding
       logging mechanism to be restricted to certain priorities of message.   Using  standard  error
       logging as an example:

### -LE pri
              will log messages of priority 'pri' and above to standard error.  See below for possi‐
              ble 'pri' values-

### -LE pri1-pri2
              will log messages with priority between 'pri1' and 'pri2' (inclusive) to standard  er‐
              ror.

       For **-LF** and **-LS** the priority specification comes before the file or facility token.

       The priorities recognised are:

              **0** or **!**  for LOG_EMERG,
              **1** or **a** for LOG_ALERT,
              **2** or **c** for LOG_CRIT,
              **3** or **e** for LOG_ERR,
              **4** or **w** for LOG_WARNING,
              **5** or **n** for LOG_NOTICE,
              **6** or **i** for LOG_INFO, and
              **7** or **d** for LOG_DEBUG.

       Normal output is (or will be!) logged at a priority level of **LOG**___**NOTICE**


## INPUT OPTIONS
       The  interpretation of input object names and the values to be assigned can be controlled us‐
       ing various parameters of the **-I** flag.  The default behaviour will be described at the end of
       this section.

### -Ib
              (case-insensitively) against object names in the MIB tree.  The "best" match  will  be
              used  -  calculated  as  the one that matches the closest to the beginning of the node
              name and the highest in the tree.  For example, the MIB object vacmSecurityModel could
              be  matched  by  the  expression vacmsecuritymodel (full name, but different case), or
              vacm.*model (regexp pattern).

              Note that '.' is a special character in regular expression patterns, so the expression
              cannot  specify  instance subidentifiers or more than one object name.  A "best match"
              expression will only be applied against single MIB object names.  For example, the ex‐
              pression  _sys*ontact.0_  would not match the instance sysContact.0 (although _sys*ontact_
              would match sysContact).  Similarly, specifying a MIB module name will not succeed (so
              _SNMPv2-[MIB::sys](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3Asys/markdown).*ontact_ would not match either).

### -Ih
              require providing the raw value:
                  snmpset ... HOST-RESOURCES-[MIB::hrSystemDate](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AhrSystemDate/markdown).0
                                  x "07 D2 0C 0A 02 04 06 08"
              instead of a formatted version:
                  snmpset ... HOST-RESOURCES-[MIB::hrSystemDate](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AhrSystemDate/markdown).0
                                  = 2002-12-10,2:4:6.8

### -Ir
              definitions.   This  will  (hopefully) result in the remote agent reporting an invalid
              request, rather than checking (and rejecting) this before it is  sent  to  the  remote
              agent.

              Local  checks  are  more  efficient (and the diagnostics provided also tend to be more
              precise), but disabling this behaviour is particularly useful when testing the  remote
              agent.

### -IR
              the desired MIB object (or qualifying this object with an explicit MIB  module  name),
              the  MIB tree will be searched for the matching object name.  Thus .iso.org.dod.inter‐
              net.mib-2.system.sysDescr.0 (or SNMPv2-[MIB::sysDescr](https://www.chedong.com/phpMan.php/perldoc/MIB%3A%3AsysDescr/markdown).0) can  be  specified  simply  as
              sysDescr.0.

              Warning:
                     Since MIB object names are not globally unique, this approach may return a dif‐
                     ferent MIB object depending on which MIB files have been loaded.

              The _MIB-[MODULE::objectName_](https://www.chedong.com/phpMan.php/perldoc/MODULE%3A%3AobjectName/markdown) syntax has the advantage of uniquely identifying a particu‐
              lar  MIB  object,  as well as being slightly more efficient (and automatically loading
              the necessary MIB file if necessary).

### -Is SUFFIX
              adds the specified suffix to each textual OID given on the command line.  This can  be
              used to retrieve multiple objects from the same row of a table, by specifying a common
              index value.

### -IS PREFIX
              adds the specified prefix to each textual OID given on the command line.  This can  be
              used  to  specify  an explicit MIB module name for all objects being retrieved (or for
              incurably lazy typists).

### -Iu
              that  OIDs  are rooted at the 'mib-2' point in the tree (unless they start with an ex‐
              plicit '.' or include a MIB module name).  So the sysDescr  instance  above  would  be
              referenced as system.sysDescr.0.


       Object  names  specified with a leading '.' are always interpreted as "fully qualified" OIDs,
       listing the sequence of MIB objects from the root of the MIB tree.  Such  objects  and  those
       qualified by an explicit MIB module name are unaffected by the **-Ib**, **-IR** and **-Iu** flags.

       Otherwise,  if  none  of  the  above input options are specified, the default behaviour for a
       "relative" OID is to try and interpret it as an (implicitly) fully qualified OID, then  apply
       "random access" lookup (**-IR**), followed by "best match" pattern matching (**-Ib**).


## ENVIRONMENT VARIABLES
       PREFIX The standard prefix for object identifiers (when using UCD-style output).  Defaults to
              .iso.org.dod.internet.mgmt.mib-2

       MIBS   The list of MIBs to load. Defaults to SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:
              UDP-MIB:SNMP-VACM-MIB.
              Overridden by the **-m** option.

       MIBDIRS
              The  list  of directories to search for MIBs. Defaults to /usr/share/snmp/mibs.  Over‐
              ridden by the **-M** option.


## FILES
       /etc/snmp/snmpd.conf
              Agent configuration file. See [_snmpd.conf(5)](https://www.chedong.com/phpMan.php/man/snmpd.conf/5/markdown)_.

       /etc/snmp/snmp.conf

       ~/.snmp/snmp.conf
              Application configuration files. See [_snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown)_.


## SEE ALSO
       [snmpget(1)](https://www.chedong.com/phpMan.php/man/snmpget/1/markdown), [snmpgetnext(1)](https://www.chedong.com/phpMan.php/man/snmpgetnext/1/markdown), [snmpset(1)](https://www.chedong.com/phpMan.php/man/snmpset/1/markdown), [snmpbulkget(1)](https://www.chedong.com/phpMan.php/man/snmpbulkget/1/markdown), [snmpbulkwalk(1)](https://www.chedong.com/phpMan.php/man/snmpbulkwalk/1/markdown), [snmpwalk(1)](https://www.chedong.com/phpMan.php/man/snmpwalk/1/markdown),  snmpt‐
       [able(1)](https://www.chedong.com/phpMan.php/man/able/1/markdown), [snmpnetstat(1)](https://www.chedong.com/phpMan.php/man/snmpnetstat/1/markdown), [snmpdelta(1)](https://www.chedong.com/phpMan.php/man/snmpdelta/1/markdown), [snmptrap(1)](https://www.chedong.com/phpMan.php/man/snmptrap/1/markdown), [snmpinform(1)](https://www.chedong.com/phpMan.php/man/snmpinform/1/markdown), [snmpusm(1)](https://www.chedong.com/phpMan.php/man/snmpusm/1/markdown), [snmpstatus(1)](https://www.chedong.com/phpMan.php/man/snmpstatus/1/markdown),
       [snmptest(1)](https://www.chedong.com/phpMan.php/man/snmptest/1/markdown), [snmp.conf(5)](https://www.chedong.com/phpMan.php/man/snmp.conf/5/markdown).




V5.9.1                                       20 Jul 2010                                  [SNMPCMD(1)](https://www.chedong.com/phpMan.php/man/SNMPCMD/1/markdown)
