%
%	$Header: snmpget.tex,v 1.1 89/01/15 19:59:38 jrd Exp $
%	Author: J. Davin
%	Copyright 1988, 1989, Massachusetts Institute of Technology
%

\newpage
\subsection{The Snmpget Command}

The snmpget command initiates a network management
query to remote management agent and displays the
response. It is coded to run in a BSD 4.3 UNIX environment.

The code for the snmpget command illustrates the use of the
Development Kit to accelerate development
of network management applications as well as the
use of the SNMP protocol {\it get} operation.

Sources for the snmpget command reside in the
\verb"snmpget" subdirectory of the Development Kit
distribution hierarchy.

The snmpget command attempts to retrieve and display the
items of management information named on the command line
according to the conventions of RFC 1067.
It is invoked with the syntax:

{\bf snmpget} [{\bf -h} {\it remoteHost}] [{\bf -p} {\it remotePort}]
[{\bf -c} {\it communityName}]
[{\bf -t} {\it timeout}]
[{\bf -i} {\it requestId}]
[{\it name} ] $\ldots$

If the {\bf -h} flag is present, then the program
will send its management request
to the IP address specified as {\it remoteHost.}

If the {\bf -p} flag is present, then the program
will send its management request
to the UDP port specified as {\it remotePort,}
instead of that assigned to the ``snmp'' service
in the \verb"/etc/services" database.

If the {\bf -c} flag is present, then the program
will generate and accept management requests
associated with the community name specified as {\it communityName,}
instead of using the community name ``public.''

If the {\bf -i} flag is present, then the program
will identify its management request by
the number specified as {\it requestId,}
instead of using the value zero.

If the {\bf -t} flag is present, then the program
will terminate after the number of seconds
specified as {\it timeout,}
instead of waiting forever for a response from the
remote agent.

For example, the command

snmpget -h anyhost 1.3.6.1.2.1.1.1.0 1.3.6.1.2.1.1.2.0

has the effect of displaying the \verb"sysDescr" and \verb"sysObjectId"
values for the host named {\it anyhost.}

