|
Packit |
fcad23 |
.\" -*- nroff -*-
|
|
Packit |
fcad23 |
.\" Portions of this file are subject to the following copyright. See
|
|
Packit |
fcad23 |
.\" the Net-SNMP COPYING file for more details and other copyrights
|
|
Packit |
fcad23 |
.\" that may apply:
|
|
Packit |
fcad23 |
.\" /***********************************************************
|
|
Packit |
fcad23 |
.\" Copyright 1988, 1989 by Carnegie Mellon University
|
|
Packit |
fcad23 |
.\"
|
|
Packit |
fcad23 |
.\" All Rights Reserved
|
|
Packit |
fcad23 |
.\"
|
|
Packit |
fcad23 |
.\" Permission to use, copy, modify, and distribute this software and its
|
|
Packit |
fcad23 |
.\" documentation for any purpose and without fee is hereby granted,
|
|
Packit |
fcad23 |
.\" provided that the above copyright notice appear in all copies and that
|
|
Packit |
fcad23 |
.\" both that copyright notice and this permission notice appear in
|
|
Packit |
fcad23 |
.\" supporting documentation, and that the name of CMU not be
|
|
Packit |
fcad23 |
.\" used in advertising or publicity pertaining to distribution of the
|
|
Packit |
fcad23 |
.\" software without specific, written prior permission.
|
|
Packit |
fcad23 |
.\"
|
|
Packit |
fcad23 |
.\" CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
Packit |
fcad23 |
.\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
Packit |
fcad23 |
.\" CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
Packit |
fcad23 |
.\" ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
Packit |
fcad23 |
.\" WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
Packit |
fcad23 |
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
Packit |
fcad23 |
.\" SOFTWARE.
|
|
Packit |
fcad23 |
.\" ******************************************************************/
|
|
Packit |
fcad23 |
.TH SNMPGET 1 "18 Jun 2007" VVERSIONINFO "Net-SNMP"
|
|
Packit |
fcad23 |
.SH NAME
|
|
Packit |
fcad23 |
snmpget - communicates with a network entity using SNMP GET requests
|
|
Packit |
fcad23 |
.SH SYNOPSIS
|
|
Packit |
fcad23 |
.B snmpget
|
|
Packit |
fcad23 |
[COMMON OPTIONS] [\-Cf] AGENT OID [OID]...
|
|
Packit |
fcad23 |
.SH DESCRIPTION
|
|
Packit |
fcad23 |
.B snmpget
|
|
Packit |
fcad23 |
is an SNMP application that uses the SNMP GET request to query for
|
|
Packit |
fcad23 |
information on a network entity. One or more object identifiers
|
|
Packit |
fcad23 |
(OIDs) may be given as arguments on the command line. Each variable
|
|
Packit |
fcad23 |
name is given in the format specified in
|
|
Packit |
fcad23 |
.IR variables(5) .
|
|
Packit |
fcad23 |
.SH "OPTIONS"
|
|
Packit |
fcad23 |
.TP 8
|
|
Packit |
fcad23 |
.B \-Cf
|
|
Packit |
fcad23 |
If
|
|
Packit |
fcad23 |
.B \-Cf
|
|
Packit |
fcad23 |
is
|
|
Packit |
fcad23 |
.I not
|
|
Packit |
fcad23 |
specified, some applications
|
|
Packit |
fcad23 |
.RB ( snmpdelta ", " snmpget ", " snmpgetnext " and " snmpstatus )
|
|
Packit |
fcad23 |
will try to fix errors returned by the agent that you were talking to
|
|
Packit |
fcad23 |
and resend the request. The only time this is really useful is if you
|
|
Packit |
fcad23 |
specified a OID that didn't exist in your request and you're using
|
|
Packit |
fcad23 |
SNMPv1 which requires "all or nothing" kinds of requests.
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
In addition to this option,
|
|
Packit |
fcad23 |
.B snmpget
|
|
Packit |
fcad23 |
takes the common options described in the
|
|
Packit |
fcad23 |
.I snmpcmd(1)
|
|
Packit |
fcad23 |
manual page.
|
|
Packit |
fcad23 |
Note that
|
|
Packit |
fcad23 |
.B snmpget
|
|
Packit |
fcad23 |
REQUIRES an argument specifying the agent to query
|
|
Packit |
fcad23 |
and at least one OID argument, as described there.
|
|
Packit |
fcad23 |
.SH "EXAMPLES"
|
|
Packit |
fcad23 |
The command:
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
snmpget \-c public zeus system.sysDescr.0
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
will retrieve the variable system.sysDescr.0 from the host
|
|
Packit |
fcad23 |
.B zeus
|
|
Packit |
fcad23 |
using the community string
|
|
Packit |
fcad23 |
.B public
|
|
Packit |
fcad23 |
:
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
system.sysDescr.0 = "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
If the network entity has an error processing the request packet, an
|
|
Packit |
fcad23 |
error packet will be returned and a message will be shown, helping to
|
|
Packit |
fcad23 |
pinpoint in what way the request was malformed. If there were other
|
|
Packit |
fcad23 |
variables in the request, the request will be resent without the bad
|
|
Packit |
fcad23 |
variable.
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
Here is another example. The \-c and \-v options are defined in the
|
|
Packit |
fcad23 |
.I snmpcmd(1)
|
|
Packit |
fcad23 |
manual page. (Note that system.sysUpTime is an incomplete
|
|
Packit |
fcad23 |
OID, as it needs the .0 index appended to it):
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.nf
|
|
Packit |
fcad23 |
snmpget \-v1 \-Cf \-c public localhost system.sysUpTime system.sysContact.0
|
|
Packit |
fcad23 |
.fi
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
This example will return the following:
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.nf
|
|
Packit |
fcad23 |
Error in packet
|
|
Packit |
fcad23 |
Reason: (noSuchName) There is no such variable name in this MIB.
|
|
Packit |
fcad23 |
This name doesn't exist: system.sysUpTime
|
|
Packit |
fcad23 |
.fi
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
Similarly, the command:
|
|
Packit |
fcad23 |
.nf
|
|
Packit |
fcad23 |
snmpget \-v1 \-c public localhost system.sysUpTime system.sysContact.0
|
|
Packit |
fcad23 |
.fi
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
Will return:
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
.nf
|
|
Packit |
fcad23 |
Error in packet
|
|
Packit |
fcad23 |
Reason: (noSuchName) There is no such variable name in this MIB.
|
|
Packit |
fcad23 |
This name doesn't exist: system.sysUpTime
|
|
Packit |
fcad23 |
|
|
Packit |
fcad23 |
system.sysContact.0 = STRING: root@localhost
|
|
Packit |
fcad23 |
.fi
|
|
Packit |
fcad23 |
.PP
|
|
Packit |
fcad23 |
With the
|
|
Packit |
fcad23 |
.B
|
|
Packit |
fcad23 |
\-Cf
|
|
Packit |
fcad23 |
flag specified the application will not try to fix the PDU for you.
|
|
Packit |
fcad23 |
.SH "SEE ALSO"
|
|
Packit |
fcad23 |
snmpcmd(1), snmpwalk(1), variables(5).
|