unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



snmp_request(8)						      snmp_request(8)



NAME

  snmp_request - Sends SNMPv1 and SNMPv2 request PDUs to an agent and prints
  the agent's response

SYNOPSIS

  /usr/sbin/snmp_request agent community request_type [-v version] [-p port]
  [-l] [-t] [-d] [-n non_repeaters] [-m	max_repetitions] [-w
  wait_seconds_max] {variable [typevalue]}

OPTIONS

  -v version
      Specifies	the type of message in which to	send the PDU. The default
      version is SNMPv1.  Use 2c to specify that the PDU be sent in an
      SNMPv2C message. If the request_type is getbulk, you must	set the	ver-
      sion to SNMPv2C (-v 2c).

  -p port
      Specifies	the port on the	managed	node to	which to send the SNMP
      request.	The default is port 161, the well-known	SNMP port.

  -l  Specifies	loop mode.  This option	is valid only if request_type is get-
      next or getbulk.	This directs the agent to perform a MIB	walk. The
      name of the variable returned by the agent is used in a subsequent
      request. The program reads and prints responses, and issues requests,
      until the	agent has no more data,	times out, or is interrupted by	a
      user.  If	you specify the	-l option and the -t option, the -l option is
      ignored.

  -n non_repeaters
      Specifies	the number of variables	for which no repetition	is requested.
      This is required when request_type is getbulk.  If you specify either
      the -t or	-l options for getbulk requests, this value must be 0.

  -m max_repetitions
      Specifies	the number of repetitions requested for	the repeating vari-
      ables.  This is required when request_type is getbulk. If	you specify
      either the -t or -l options for getbulk requests,	this value must	be 1.

  -t  Specifies	a tree walk.  This option is valid only	if request_type	is
      getnext or getbulk.  This	directs	the agent to perform a MIB walk	for
      the subtree with the variable parameter as its root. The program reads
      and prints responses, and	issues requests, until the agent has no	more
      data for the specified subtree, times out, or is interrupted by a	user.
      Only one OID is permitted	for a tree walk.

  -w wait_seconds_max
      Specifies	the maximum number of seconds to wait for a reply from the
      agent. The default is 3 seconds.

  variable
      Specifies	the object identifier of a MIB variable	(in dot	notation).

      For Get and Set operations, the object identifier	must be	fully quali-
      fied; it must specify an instance.

  type
      Specifies	the data type for SetRequests.	The type parameter can be one
      of the following:

	+  a --	ip_addr

	+  c --	Counter	32

	+  d --	Object identifier (in dot notation)

	+  D --	Display	string

	+  g --	Gauge

	+  i --	Integer

	+  l --	Counter	64

	+  o --	Octet string (in hexadecimal format)

	+  N --- Null

	+  q --	Opaque string (in hexadecimal format)

	+  t --	time_ticks

  value
      Specifies	the data value for SetRequests.	 The data value	must
      correspond to the	data type.

OPERANDS

  agent
      Specifies	the host name or IP address (in	dot notation) of the managed
      node to query.

  community
      Specifies	the community name to use in the SNMP message header.

  request_type
      Specifies	the type of protocol data unit (PDU) to	send.  The
      request_type can be one of the following:

	+  get -- Get Request PDU

	+  getbulk -- GetBulk Request PDU

	+  getnext -- GetNext Request PDU

	+  set -- SetRequest PDU

DESCRIPTION

  The snmp_request program sends an SNMP Get, GetBulk, GetNext,	or Set
  request to a logically remote	SNMP agent, and	prints the agent's response.







EXAMPLES

   1.  To obtain the value of the MIB II sysDescr variable from	host ZIGGY,
       using the default community name, enter:
	    snmp_request ZIGGY public get 1.3.6.1.2.1.1.1.0

   2.  To set ZIGGY's sysContact variable to Katy Lied,	enter:
	    snmp_request ZIGGY special_comm_1 set 1.3.6.1.2.1.1.4.0 \
	    -D "Katy Lied"

       Be sure to use a	community name that has	been configured	on that	sys-
       tem to allow sets.

   3.  To obtain the values of the MIB II sysUpTime.0 and sysDescr.0 vari-
       ables and, for the first	three interfaces, the values of	ifDescr	and
       ifType from the agent on	host marley, using the SNMPv2 GetBulk PDU,
       enter:.
	    snmp_request marley	public getbulk -v 2c -n	2 \
	    -m 3 1.3.6.1.2.1.1.1 1.3.6.1.2.1.1.2 1.3.6.1.2.1.2.2.1.2 \
	    1.3.6.1.2.1.2.2.1.3

   4.  To obtain the values of the MIB II hrDeviceDescr	variables, enter:
	    snmp_request marley	public getnext -t 1.3.6.1.2.1.25.3.2.1.3



SEE ALSO

  Commands: snmpd(8), snmp_traprcv(8), snmp_trapsnd(8)