Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
International Medical Corps

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 144 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

snmpcmd




SYNOPSIS

       snmpcmd [-h|-H|-V]
       [-v (1 | 2c | 3) ]
       [-O <OUTOPTS> ] [-I <INOPTS> ]
       [-P <PARSEROPTS> ]
       [-m mibs] [-M mibdirs]
       [-d] [-D <TOKEN[,TOKEN,...]> ]
       [-r retries] [-t timeout] [-p port] [-T UDP|TCP]
       [-c community]
       [-e engineid] [-Z boots time] [-n contextname]
       [-l seclevel] [-u secname]
       [-a authproto] [-A authpasswd] [-x  privproto]  [-X  priv­
       passwd]
       agent [community] commandparams


DESCRIPTION

       This  manual page describes the common part of the parame­
       ters for the  SNMP  commands:  snmpbulkget,  snmpbulkwalk,
       snmpdelta,  snmpget,  snmpgetnext,  snmpnetstat,  snmpset,
       snmpstatus, snmptable, snmptest, snmptrap, snmpusm,  snmp­
       walk.  The command line applications use the SNMP protocol
       to communicate with an SNMP  capable  network  entity,  an
       agent.   The  applications may provide additional command­
       params that are specified after the agent and  authentica­
       tion controls specified here.

       -h     prints the applications help message

       -H     display  the  configuration  file directives under­
              stood be the command

       -V     prints the applications version string

       -v 1 | 2c | 3
              specifies the  protocol  version  to  use:  1  (RFC
              1155-1157),   2c   (RFC   1901-1908),   or  3  (RFC
              2571-2574) The default is -v 1

       -P wWecduR
              specifies MIB  parsing  options.  See  MIB  PARSING
              OPTIONS below.

       -O nEebqfsSvXT
              specifies   output  printing  options.  See  OUTPUT
              OPTIONS below.

       -I Rbr specifies input parsing options. See INPUT  OPTIONS
              below.

       -m mibs
              specifies  a colon separated list of MIB modules to

       -D <TOKEN[,TOKEN,...]>
              request  debugging  output.   The  comma  separated
              TOKENs list specifies what type of debugging infor­
              mation  you which to view.  Only debugging informa­
              tion about those TOKEN types will be shown to  you.
              Only the beginning of the token needs to match.  In
              other words, specifying -DmibII will  print  debug­
              ging  output for debugging symbols mibII as well as
              mibII/system.

              The special keyword "all" will display  all  debug­
              ging output.

              The  special  keyword  "trace"  will display source
              code tracing output.

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

       -t timeout
              specifies  the timeout between retries. The default
              is 1.

       -p port
              specifies the  port  to  communicate  with  at  the
              agent.  The  default  is  161, except for snmptrap,
              which defaults to 162.

       -T UDP|TCP
              specifies the transport type to use.   By  default,
              UDP is used unless TCP is specified here.

       -c community
              specifies the v1/v2c community for the transaction.

       -e engineid
              sets the authoritative(security) engineID used  for
              SNMP  v3 Request messages.  This is the engineID of
              the  agent  or  proxy  (e.g.,  800000020109840301).
              (will be discovered if not supplied)

       -E engineid
              sets  the context engineID used for SNMP v3 Request
              messages scopedPdu.  This is the  engineID  of  the
              agent (e.g., 800000020109840301). (will be authori­
              tative engineID if not specified)

       -Z boots,time
              sets  the  engineBoots  and  engineTime  used   for
              authenticated SNMP v3 messages.  This will initial­

       -u secname
              sets  the  securityName used for authenticated SNMP
              v3 messages.

       -a authproto
              sets the authentication protocol (MD5|SHA) used for
              authenticated SNMP v3 messages.

       -A authpasswd
              sets   the  authentication  pass  phrase  used  for
              authenticated SNMP v3 messages.

       -x privproto
              sets the privacy protocol (DES) used for  encrypted
              SNMP v3 messages.

       -X privpasswd
              sets  the  privacy  pass  phrase used for encrypted
              SNMP v3 messages.

       The agent specification may be either a host  name  or  an
       internet address specified in "dot notation".

       The version 1, or version 2c, community specifies the com­
       munity name for the transaction with  the  remote  system.
       If a snmp.conf file specifies a defCommunity this is not a
       positional parameter. You should use the -c community form
       anyway.


MIB PARSING OPTIONS

       The  UCD parser mostly adheres to the Structure of Manage­
       ment Information (SMI).  As that specification has changed
       through  time, and in recognition of the diversity in com­
       pliance expressed in MIB files, additional options provide
       more flexibility in reading MIB files.

       -Pw    Show  some  warning  messages  in resolving the MIB
              files.  Can be  also  set  with  the  configuration
              token "mibWarningLevel".

       -PW    Show  additional warning messages.  Can be also set
              with the configuration token "mibWarningLevel".

       -Pe    Don't show MIB errors.  Can be also  set  with  the
              configuration token "showMibErrors".

       -Pc    Allow ASN.1 comment to extend to the end of the MIB
              source line.  This  overcomes  some  problems  with
              manually  maintained  MIB  files.   Can be also set
              with the configuration token "strictCommentTerm".


OUTPUT OPTIONS

       Output display can be controlled by passing various param­
       eters to the  -O  flag.   The  following  examples  should
       demonstrate this.

       The default output looks as follows:
       snmpget -c public localhost system.sysUpTime.0
       system.sysUpTime.0   =   Timeticks:   (14096763)   1  day,
       15:09:27.63

       -Oq    removes the equal sign and type information,
              system.sysUpTime.0 1:15:09:27.63

       -Of    gives you the complete OID
               .iso.org.dod.internet.mgmt.mib-2.system.sysUp­
              Time.0 = Timeticks: (14096763) 1 day, 15:09:27.63

       -Os    deletes all by the last symbolic part of the OID
              sysUpTime.0   =   Timeticks:   (14096763)   1  day,
              15:09:27.63

       -OS    is a variant of this, adding the name  of  the  MIB
              that defined this object
              SNMPv2-MIB::sysUpTime.0  =  Timeticks: (14096763) 1
              day, 15:09:27.63

       -On    prints the OID numerically
              snmpget -On -c public localhost system.sysUpTime.0
               .1.3.6.1.2.1.1.3.0 = Timeticks: (14096763) 1  day,
              15:09:27.63

       -Oe    removes the symbolic labels from enumerations:
              snmpget -c public localhost ip.ipForwarding.0
              ip.ipForwarding.0 = forwarding(1)
              snmpget -c public -Oe localhost ip.ipForwarding.0
              ip.ipForwarding.0 = 1

       -Ob    When OIDs contain a index to a table, they are bro­
              ken into the displayable pieces and shown  to  you.
              For      example      the     oid     vacmSecurity­
              Model.0.3.119.101.115  is  nicely  broken  down  by
              default  and  the string hidden in the oid is shown
              to  you  as  vacmSecurityModel.0."wes".   The   -Ob
              option  diables  this  feature  and  displays it as
              vacmSecurityModel.0.3.119.101.115 again.

       -OE    This modifies the index strings to include a  \  to
              escape  the  quotes,  to allow them to be reused in
              shell commands, such as vacmSecurityModel.0.\"wes\"

       -OX    This  modifies  the  output  of index oids, to look
              mal codes.

       -Ov    Output only the variable value, not the OID:
              snmpget -c public -Ov localhost ip.ipForwarding.0
              forwarding(1)

       -Ot    Output timeticks values as raw numbers.
              $ snmpget -Ot  -c  public  localhost  system.sysUp­
              Time.0 system.sysUpTime.0 = 206996857

       Note that most of these options can be turned on or off by
       default  by  tuning   the   snmp.conf   file.    See   the
       snmp.conf(5) manual page for details.


INPUT OPTIONS

       The  -I  flag  specifies  various options that control how
       your input to the program  is  parsed.   By  default,  all
       input  parsing  methods  are used: First the oid is parsed
       regularly, then -IR is used, then -Ib is used, unless  one
       of the following flags is specified which will force it to
       only use one method.

       -IR    The -IR flag specifies  random  access  lookup,  so
              that  if  the  entire OID path is not specified, it
              will search for a node in the mib  tree  with  your
              name.   Normally, you'd have to specify the vacmSe­
              curityModel oid above as
               .iso.org.dod.internet.snmpV2.snmpModules.snmpVacm­
              MIB.vacmMIBObjects.vacmSecurityToGroupTable.vacmSe­
              curityToGroupEntry.vacmSecurityModel.0."wes",   but
              the  use of the -IR flag allows you to shorten that
              to just  vacmSecurityModel.0."wes".   (Though  this
              OID  really  needs  to  be  quoted - 'vacmSecurity­
              Model.0."wes"' - to prevent the shell from swallow­
              ing the double quotes).

              Additionally,  see  the  RANDOM ACCESS MIBS section
              below.

       -Ib    The -Ib flag indicates that the expression you gave
              it  is actually a regular expression that should be
              used to search for the best match possible  in  the
              mib tree.  This would allow you to specify the node
              vacmSecurityModel MIB node as something as  generic
              as   vacmsecuritymodel   (since   case  insensitive
              searches are done) or vacm.*model.  Note that  mul­
              tiple  matches  are obviously possible (.*  matches
              everything), and the best result is currently  cal­
              culated  as the one that matches the closest to the
              beginning of the node name and the highest  in  the
              tree.  A current side effect of this option is that
              you can't specify indexes or multiple nodes,  since

       will be lookup in a single "wellknown" place,  built  into
       the  SNMP  library (or specified by the PREFIX environment
       variable).  The  standard  place  is:  .iso.org.dod.inter­
       net.mgmt.mib-2.   The  identifier  may  alternatively be a
       complete object identifier, this is designated by a  lead­
       ing  "dot".  To simplify the specification of object iden­
       tifiers the library supports random access to the  identi­
       fiers  in the MIBs. This is requested by the -IR option to
       the SNMP applications.  Additionally, -Os prints  oids  in
       this  manner.   Using  this, system.sysDescr.0 may also be
       entered as sysDescr.0.  To search only a  single  MIB  for
       the  identifier  (if it appears in more than one), specify
       it as SNMPv2-MIB::sysDescr.0. (use  -OS  to  print  output
       oids  in  this  manner). This notation will also make sure
       that the specified MIB is loaded, i.e. it need not be men­
       tioned in the -m option (or MIBS environment variable).


ENVIRONMENT VARIABLES

       PREFIX The   standard   prefix   for  object  identifiers.
              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 PREFIX/share/snmp/mibs.  Overridden by
              the -M option

       SUFFIX If this variable is set, the applications  acts  as
              if the -s option is specified.


FILES

       PREFIX/share/snmp/snmpd.conf
              Agent configuration file. See snmpd.conf(5)

       PREFIX/share/snmp/snmp.conf

       ~/.snmp/snmp.conf
              Application configuration files. See snmp.conf(5)


SEE ALSO

       snmpget(1),  snmpgetnext(1),  snmpset(1),  snmpbulkget(1),
       snmpbulkwalk(1),   snmpwalk(1),   snmptable(1),   snmpnet­
       stat(1),  snmpdelta(1),  snmptrap(1),  snmpinform(1), snm­
       pusm(1), snmpstatus(1), snmptest(1), snmp.conf(5).

                           28 Mar 2001                 SNMPCMD(1)
  
Help us cut cost by not downloading the whole site!
Use of automated download sofware ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and therefore is expressedly prohibited. For more details on this, take a look here

Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
The Linux Tutorial welcomes your suggestions and ideas.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.04 Seconds