1SNMPTEST(1)                        Net-SNMP                        SNMPTEST(1)
2
3
4

NAME

6       snmptest - communicates with a network entity using SNMP requests
7

SYNOPSIS

9       snmptest [COMMON OPTIONS] AGENT
10

DESCRIPTION

12       snmptest is a flexible SNMP application that can monitor and manage in‐
13       formation on a network entity.
14
15       After invoking the program, a command line interpreter proceeds to  ac‐
16       cept  commands.   This  intepreter  enables  the user to send different
17       types of SNMP requests to target agents.
18
19       AGENT identifies a target SNMP agent, which is instrumented to  monitor
20       the  given objects.  At its simplest, the AGENT specification will con‐
21       sist of a hostname or an IPv4 address.  In this situation, the  command
22       will  attempt  communication with the agent, using UDP/IPv4 to port 161
23       of the given target host. See snmpcmd(1) for a full list of the  possi‐
24       ble formats for AGENT.
25
26       Once snmptest is invoked, the command line intepreter will prompt with:
27
28       Variable:
29
30       At  this  point you can enter one or more variable names, one per line.
31       A blank line ends the parameter input and will send the request  (vari‐
32       ables entered) in a single packet, to the remote entity.  Each variable
33       name is given in the format specified in variables(5).  For example:
34
35       snmptest -c public -v 1 zeus
36       Variable: system.sysDescr.0
37       Variable:
38
39       will return some information about the request and  reply  packets,  as
40       well as the information:
41
42       requestid 0x5992478A errstat 0x0 errindex 0x0
43       system.sysDescr.0 = STRING: "Unix 4.3BSD"
44
45       The errstatus value shows the error status code for the call.  The pos‐
46       sible values for errstat are in the header file snmp.h.   The  errindex
47       value  identifies  the variable that has the given error.  Index values
48       are assigned to all the variables entered at  the  "Variable":  prompt.
49       The first value is assigned an index of 1.
50
51       Upon  startup,  the  program  defaults to sending a GET request packet.
52       The type of request can be changed by typing one of the following  com‐
53       mands at the "Variable:" prompt:
54
55       $G - send a GET request
56       $N - send a GETNEXT request
57       $S - send a SET request
58       $B - send a GETBULK request
59            Note: GETBULK is not available in SNMPv1
60       $I - send an Inform request
61       $T - send an SNMPv2 Trap request
62
63       Other values that can be entered at the "Variable:" prompt are:
64
65       $D - toggle the dumping of each sent and received packet
66       $QP - toggle a quicker, less verbose output form
67       $Q - Quit the program
68
69       Request Types:
70
71       GET Request:
72
73       When  in  "GET request" mode ($G or default), the user can enter an OID
74       at the "Variable:" prompt. The user can enter multiple  OIDs,  one  per
75       prompt. The user enters a blank line to send the GET request.
76
77       GETNEXT Request:
78
79       The  "GETNEXT  request" mode ($N) is similar to the "Get request" mode,
80       described above.
81
82       SET Request:
83
84       When in the "SET request" mode ($S), more information is  requested  by
85       the prompt for each variable.  The prompt:
86
87       Type [i|s|x|d|n|o|t|a]:
88       requests the type of the variable be entered.  Depending on the type of
89       value you want to set, you can type one of the following:
90
91       i - integer
92       u - unsigned integer
93       s - octet string in ASCII
94       x - octet string in hex bytes, separated by whitespace
95       d - octet string as decimal bytes, separated by whitespace
96       a - ip address in dotted IP notation
97       o - object identifier
98       n - null
99       t - timeticks
100       At this point a value will be prompted for:
101
102       Value:
103
104       If this is an integer value, just type the integer (in decimal).  If it
105       is a decimal string, type in white-space separated decimal numbers, one
106       per byte of the string.  Again type a blank line at the prompt for  the
107       variable name to send the packet.
108
109       GETBULK Request:
110
111       The  "GETBULK  request" mode ($B) is similar to the "Set request" mode.
112       GETBULK, however, is not available in SNMPv1.
113
114       Inform Request:
115
116       The "Inform request" mode ($I) is similar to the  "Set  request"  mode.
117       This  type  of  request, however, is not available in SNMPv1. Also, the
118       _agent_ specified on the snmptest command should correspond to the tar‐
119       get snmptrapd agent.
120
121       SNMPv2 Trap Request:
122
123       The  "SNMPv2  Trap  Request"  mode ($T) is similar to the "Set request"
124       mode.  This type of request, however, is not available in SNMPv1. Also,
125       the  _agent_ specified on the snmptest command should correspond to the
126       target snmptrapd agent.
127

OPTIONS

129       snmptest takes the common options described in  the  snmpcmd(1)  manual
130       page.
131

EXAMPLES

133       The following is an example of sending a GET request for two OIDs:
134
135       % snmptest -v 2c -c public testhost:9999
136
137       Variable: system.sysDescr.0
138       Variable: system.sysContact.0
139       Variable:
140       Received Get Response from 128.2.56.220
141       requestid 0x7D9FCD63 errstat 0x0 errindex 0x0
142       SNMPv2-MIB::sysDescr.0 = STRING: SunOS testhost 5.9 Generic_112233-02 sun4u
143       SNMPv2-MIB::sysContact.0 = STRING: x1111
144
145       The following is an example of sending a GETNEXT request:
146
147       Variable: SNMPv2-MIB::sysORUpTime
148       Variable:
149       Received Get Response from 128.2.56.220
150       requestid 0x7D9FCD64 errstat 0x0 errindex 0x0
151       SNMPv2-MIB::sysORUpTime.1 = Timeticks: (6) 0:00:00.06
152       Variable:
153
154       The following is an example of sending a SET request:
155
156       Variable: $S
157       Request type is Set Request
158       Variable: system.sysLocation.0
159       Type [i|u|s|x|d|n|o|t|a]: s
160       Value: building 17
161       Variable:
162       Received Get Response from 128.2.56.220
163       requestid 0x7D9FCD65 errstat 0x0 errindex 0x0
164       SNMPv2-MIB::sysLocation.0 = STRING: building A
165       Variable:
166
167       The following is an example of sending a GETBULK request:
168
169       Variable: $B
170       Request type is Bulk Request
171       Enter a blank line to terminate the list of non-repeaters
172       and to begin the repeating variables
173       Variable:
174       Now input the repeating variables
175       Variable: system.sysContact.0
176       Variable: system.sysLocation.0
177       Variable:
178       What repeat count? 2
179       Received Get Response from 128.2.56.220
180       requestid 0x2EA7942A errstat 0x0 errindex 0x0
181       SNMPv2-MIB::sysName.0 = STRING: testhost
182       SNMPv2-MIB::sysORLastChange.0 = Timeticks: (58) 0:00:00.58
183       SNMPv2-MIB::sysLocation.0 = STRING: bldg A
184       SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
185       Variable:
186
187       The following is an example of sending an Inform request:
188
189       snmptest -v 2c -c public snmptrapd_host
190       Variable: $I
191       Request type is Inform Request
192       (Are you sending to the right port?)
193       Variable: system.sysContact.0
194       Type [i|u|sIx|d|n|o|t|a]: s
195       Value: x12345
196       Variable:
197       Inform Acknowledged
198       Variable:
199
200       The snmptrapd_host will show:
201
202       snmptrapd_host  [<ip address>]: Trap SNMPv2-MIB::sysContact.0 = STRING:
203       x12345
204
205       The following is an example of sending an SNMPv2 Trap request:
206
207       snmptest -v 2c -c public snmptrapd_host
208       Variable: $T
209       Request type is SNMPv2 Trap Request
210       (Are you sending to the right port?)
211       Variable: system.sysLocation.0
212       Type [i|u|s|x|d|n|o|t|a]: s
213       Value: building a
214       Variable:
215
216       The snmptrapd_host will show:
217
218       snmptrapd_host [<ip address>]: Trap SNMPv2-MIB::sys.0 = STRING:
219       building a
220

SEE ALSO

222       snmpcmd(1), snmpget(1), snmpset(1), variables(5)
223
224
225
226V5.9.4.pre2                       25 Jul 2003                      SNMPTEST(1)
Impressum