beautypg.com

2 using the trap sender and trap receiver programs – Compaq AAR04BCTE User Manual

Page 52

background image

Using the SNMP Utilities
4.1 Using the MIB Browser

6.

The following example uses the same command as in example 5, but it
specifies the

-t

flag instead of the

-l

flag. Only OIDs with the prefix

matching the input OID are returned. Note that as with other

getnext

request examples, the value for the input OID is not returned. If an SNMP
Version 2 agent is the server, the results using

getbulk

are identical.

$ snmp_request marley.dec.com "public" getnext -t 1.3.6.1.2.1.1

1.3.6.1.2.1.1.2.0 = 1.3.6.1.4.1.36.2.15.13.7.1
1.3.6.1.2.1.1.3.0 = 1302232 = 0 d 3:37:2
1.3.6.1.2.1.1.4.0 = Sam Spade
1.3.6.1.2.1.1.5.0 = marley.dec.com
1.3.6.1.2.1.1.6.0 = Falcon BuildingLos Angeles, CA
1.3.6.1.2.1.1.7.0 = 72
1.3.6.1.2.1.1.8.0 = 0 = 0 d 0:0:0
1.3.6.1.2.1.1.9.1.2.1 = 1.3.6.1.4.1.36.15.3.3.1.1
1.3.6.1.2.1.1.9.1.2.2 = 1.3.6.1.4.1.36.15.3.3.1.2
1.3.6.1.2.1.1.9.1.3.1 = Base o/s agent (OS_MIBS) capabilities
1.3.6.1.2.1.1.9.1.3.2 = Base o/s agent (HR_MIB) capabilities
1.3.6.1.2.1.1.9.1.4.1 = 0 = 0 d 0:0:0
1.3.6.1.2.1.1.9.1.4.2 = 0 = 0 d 0:0:0

7.

The following example shows how to send a

Set

request. The request succeeds

because the command line specifies the correct type for the variable, and all
the conditions for enabling

Set

requests are met on the server.

$ snmp_request marley.dec.com "address_list" -
_$ set 1.3.6.1.2.1.1.4.0 "D" "Richard Blaine"

1.3.6.1.2.1.1.4.0 = Richard Blaine

8.

The following example shows how to display the contents of packets that
are sent and received. Note that only the SNMP-specific portion of the UDP
packets is displayed.

$ snmp_request marley.dec.com "public" get -d 1.3.6.1.2.1.1.4.0

Sent:

3082002D 02010004 06707562 6C6963A0

0..-.....public.

2002047B E9C1BD02 01000201 00308200

..{.........0..

10308200 0C06082B 06010201 01040005

.0.....+........

00

.

Received:

3082003B 02010004 06707562 6C6963A2

0..;.....public.

2E02047B E9C1BD02 01000201 00308200

...{.........0..

1E308200 1A06082B 06010201 01040004

.0.....+........

0E526963 68617264 20426C61 696E65

.Richard Blaine

1.3.6.1.2.1.1.4.0 = Richard Blaine

4.2 Using the Trap Sender and Trap Receiver Programs

TCP/IP Services provides the following programs that allow you to set up a
simple client on your system to send and receive trap messages:

snmp_trapsnd

(TCPIP$SNMP_TRAPSND.EXE)

Sends SNMP Version 1 and SNMP Version 2 trap messages. Use only for
testing or to send significant state changes that occur on the managed node.

snmp_traprcv

(TCPIP$SNMP_TRAPRCV.EXE)

Listens for SNMP trap messages and displays any it receives.

4–8 Using the SNMP Utilities