xref: /freebsd/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 (revision 3d265fce43746c293ae826e9603adbfe09f93cf6)
1a7398723SShteryana Shopova.\"
2a7398723SShteryana Shopova.\" Copyright (c) 2010 The FreeBSD Foundation
3a7398723SShteryana Shopova.\" All rights reserved.
4a7398723SShteryana Shopova.\"
5a7398723SShteryana Shopova.\" Portions of this documentation were written by Shteryana Sotirova Shopova
6a7398723SShteryana Shopova.\" under sponsorship from the FreeBSD Foundation.
7a7398723SShteryana Shopova.\"
8a7398723SShteryana Shopova.\" Copyright (c) 2005-2007 The FreeBSD Project.
9a7398723SShteryana Shopova.\"	All rights reserved.
10a7398723SShteryana Shopova.\"
11a7398723SShteryana Shopova.\" Author: Shteryana Shopova <syrinx@FreeBSD.org>
12a7398723SShteryana Shopova.\"
13a7398723SShteryana Shopova.\" Redistribution and use in source and binary forms, with or without
14a7398723SShteryana Shopova.\" modification, are permitted provided that the following conditions
15a7398723SShteryana Shopova.\" are met:
16a7398723SShteryana Shopova.\" 1. Redistributions of source code must retain the above copyright
17a7398723SShteryana Shopova.\"    notice, this list of conditions and the following disclaimer.
18a7398723SShteryana Shopova.\" 2. Redistributions in binary form must reproduce the above copyright
19a7398723SShteryana Shopova.\"    notice, this list of conditions and the following disclaimer in the
20a7398723SShteryana Shopova.\"    documentation and/or other materials provided with the distribution.
21a7398723SShteryana Shopova.\"
22a7398723SShteryana Shopova.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23a7398723SShteryana Shopova.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24a7398723SShteryana Shopova.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25a7398723SShteryana Shopova.\" ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
26a7398723SShteryana Shopova.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27a7398723SShteryana Shopova.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28a7398723SShteryana Shopova.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29a7398723SShteryana Shopova.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30a7398723SShteryana Shopova.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31a7398723SShteryana Shopova.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32a7398723SShteryana Shopova.\" SUCH DAMAGE.
33a7398723SShteryana Shopova.\"
34a7398723SShteryana Shopova.\" $FreeBSD$
35a7398723SShteryana Shopova.\"
36b9288caaSShteryana Shopova.Dd January 10, 2012
37a7398723SShteryana Shopova.Dt BSNMPGET 1
38a7398723SShteryana Shopova.Os
39a7398723SShteryana Shopova.Sh NAME
40a7398723SShteryana Shopova.Nm bsnmpget ,
41a7398723SShteryana Shopova.Nm bsnmpwalk ,
42a7398723SShteryana Shopova.Nm bsnmpset
43a7398723SShteryana Shopova.Nd "simple tools for querying SNMP agents"
44a7398723SShteryana Shopova.Sh SYNOPSIS
45a7398723SShteryana Shopova.Nm
46a7398723SShteryana Shopova.Op Fl aDdehnK
47a7398723SShteryana Shopova.Op Fl A Ar options
48a7398723SShteryana Shopova.Op Fl b Ar buffersize
49a7398723SShteryana Shopova.Op Fl C Ar options
50a7398723SShteryana Shopova.Op Fl I Ar options
51a7398723SShteryana Shopova.Op Fl i Ar filelist
52a7398723SShteryana Shopova.Op Fl l Ar filename
53a7398723SShteryana Shopova.Op Fl M Ar max-repetitions
54a7398723SShteryana Shopova.Op Fl N Ar non-repeaters
55a7398723SShteryana Shopova.Op Fl o Ar output
56a7398723SShteryana Shopova.Op Fl P Ar options
57a7398723SShteryana Shopova.Op Fl p Ar pdu
58a7398723SShteryana Shopova.Op Fl r Ar retries
59a7398723SShteryana Shopova.Op Fl s Ar [trans::][community@][server][:port]
60a7398723SShteryana Shopova.Op Fl t Ar timeout
61a7398723SShteryana Shopova.Op Fl U Ar options
62a7398723SShteryana Shopova.Op Fl v Ar version
63a7398723SShteryana Shopova.Op Ar OID ...
64a7398723SShteryana Shopova.Pp
65a7398723SShteryana Shopova.Nm bsnmpwalk
66a7398723SShteryana Shopova.Op Fl dhnK
67a7398723SShteryana Shopova.Op Fl A Ar options
68a7398723SShteryana Shopova.Op Fl b Ar buffersize
69a7398723SShteryana Shopova.Op Fl C Ar options
70a7398723SShteryana Shopova.Op Fl I Ar options
71a7398723SShteryana Shopova.Op Fl i Ar filelist
72a7398723SShteryana Shopova.Op Fl l Ar filename
73a7398723SShteryana Shopova.Op Fl o Ar output
74a7398723SShteryana Shopova.Op Fl P Ar options
75a7398723SShteryana Shopova.Op Fl r Ar retries
76a7398723SShteryana Shopova.Op Fl s Ar [trans::][community@][server][:port]
77a7398723SShteryana Shopova.Op Fl t Ar timeout
78a7398723SShteryana Shopova.Op Fl U Ar options
79a7398723SShteryana Shopova.Op Fl v Ar version
80a7398723SShteryana Shopova.Op Ar OID ...
81a7398723SShteryana Shopova.Pp
82a7398723SShteryana Shopova.Nm bsnmpset
83a7398723SShteryana Shopova.Op Fl adehnK
84a7398723SShteryana Shopova.Op Fl A Ar options
85a7398723SShteryana Shopova.Op Fl b Ar buffersize
86a7398723SShteryana Shopova.Op Fl C Ar options
87a7398723SShteryana Shopova.Op Fl I Ar options
88a7398723SShteryana Shopova.Op Fl i Ar filelist
89a7398723SShteryana Shopova.Op Fl l Ar filename
90a7398723SShteryana Shopova.Op Fl o Ar output
91a7398723SShteryana Shopova.Op Fl P Ar options
92a7398723SShteryana Shopova.Op Fl r Ar retries
93a7398723SShteryana Shopova.Op Fl s Ar [trans::][community@][server][:port]
94a7398723SShteryana Shopova.Op Fl t Ar timeout
95a7398723SShteryana Shopova.Op Fl U Ar options
96a7398723SShteryana Shopova.Op Fl v Ar version
97a7398723SShteryana Shopova.Ar OID Ns = Ar syntax Ns : Ns Ar value
98a7398723SShteryana Shopova.Op Ar OID Ns = Ar syntax Ns : Ns Ar value ...
99a7398723SShteryana Shopova.Sh DESCRIPTION
100a7398723SShteryana Shopova.Nm ,
101a7398723SShteryana Shopova.Nm bsnmpwalk
102a7398723SShteryana Shopovaand
103a7398723SShteryana Shopova.Nm bsnmpset
104a7398723SShteryana Shopovaare simple tools for retrieving management information from and setting
1053df5ecacSUlrich Spörleinmanagement information to a Simple Network Management Protocol (SNMP) agent.
106a7398723SShteryana Shopova.Pp
107a7398723SShteryana ShopovaDepending on the options
108a7398723SShteryana Shopova.Nm bsnmpget
109550c00acSChristian Bruefferconstructs either a SNMP GetRequest, GetNextRequest
110a7398723SShteryana Shopovaor a GetBulkRequest packet, fills in the object identifiers (OIDs) of the
1112063b2c0SJoel Dahlobjects whose values will be retrieved, waits for a response and prints it if
112a7398723SShteryana Shopovareceived successfully.
113a7398723SShteryana Shopova.Pp
114a7398723SShteryana Shopova.Nm Bsnmpwalk
115550c00acSChristian Bruefferqueries an agent with ether SNMP GetNextRequest or GetBulkRequest packets,
116a7398723SShteryana Shopovaasking for values of OID instances that are a part of the object subtree
117a7398723SShteryana Shopovarooted at the provided OIDs.
118a7398723SShteryana Shopova.Pp
119a7398723SShteryana Shopova.Nm Bsnmpset
120550c00acSChristian Bruefferconstructs a SNMP SetRequest packet, fills in the OIDs (object identifiers),
121a7398723SShteryana Shopovasyntaxes and values of the objects whose values are to be set and waits for a
1223df5ecacSUlrich Spörleinresponse from server.
123a7398723SShteryana Shopova.Sh OPTIONS
124a7398723SShteryana ShopovaThe options are as follows (not all apply to all three programs):
125a7398723SShteryana Shopova.Bl -tag -width ".It Fl D Ar options"
126a7398723SShteryana Shopova.It Fl A Ar options
127a7398723SShteryana ShopovaAuthentication options to use with SNMPv3 PDUs
128f0720ed5SUlrich Spörlein.Bl -tag -width \&
129a7398723SShteryana Shopova.It Cm proto=[md5|sha]
130a7398723SShteryana ShopovaThe protocol to use when calculating the PDU message digest.
131a7398723SShteryana Shopova.It Cm key=authkey
132a7398723SShteryana ShopovaA binary localized authentication key to use when calculating the PDU message
133a7398723SShteryana Shopovadigest.
134a7398723SShteryana Shopova.El
135a7398723SShteryana Shopova.Pp
136a7398723SShteryana ShopovaBy default SNMPv3 PDUs are sent unauthenticated.
137a7398723SShteryana Shopova.It Fl a
138a7398723SShteryana ShopovaSkip any sanity checks when adding OIDs to a Protocol Data Unit (PDU):
139a7398723SShteryana Shopovaingore syntax/access type, allow adding of non-leaf objects for GetPdu and
140a7398723SShteryana Shopovaread-only objects to a SetPDU.
141a7398723SShteryana Shopova.It Fl b Ar buffersize
142a7398723SShteryana ShopovaTune the size of buffers used to send and receive packets.
143a7398723SShteryana ShopovaThe default size is 10000 bytes which should be enough unless an agent sends
144a7398723SShteryana Shopovaa really large octetstring.
145a7398723SShteryana ShopovaThe maximum allowed length is 65535 according to the Structure of Management
146a7398723SShteryana ShopovaInformation (SMIv2).
147a7398723SShteryana Shopova.It Fl C Ar options
148a7398723SShteryana ShopovaThe context to query with SNMPv3 PDUs.
149f0720ed5SUlrich Spörlein.Bl -tag -width \&
150a7398723SShteryana Shopova.It Cm context=name
151*3d265fceSGordon BerglingThe context name.
152*3d265fceSGordon BerglingDefault is "" (empty).
153a7398723SShteryana Shopova.It Cm context-engine=engine-id
154a7398723SShteryana ShopovaThe SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as
155550c00acSChristian Bruefferbinary octet string.
156550c00acSChristian BruefferBy default, this is set to the Engine ID of the SNMP agent.
157a7398723SShteryana Shopova.El
158a7398723SShteryana Shopova.It Fl D
159a7398723SShteryana ShopovaPerform SNMP USM Engine Discovery, rather than sending a request for the value
160a7398723SShteryana Shopovaof a specific object.
161a7398723SShteryana Shopova.It Fl d
162a7398723SShteryana ShopovaTurn on debugging.
163a7398723SShteryana ShopovaThis option will cause the packets sent and received to be dumped to the
164a7398723SShteryana Shopovaterminal.
165a7398723SShteryana Shopova.It Fl e
166a7398723SShteryana ShopovaRetry on error.
167a7398723SShteryana ShopovaIf an error is returned in the response PDU, resend the request removing the
168a7398723SShteryana Shopovavariable that caused the error until a valid response is received.
1693df5ecacSUlrich SpörleinThis is only useful for a GetRequest- and a GetNextRequest-PDU.
170a7398723SShteryana Shopova.It Fl h
171a7398723SShteryana ShopovaPrint a short help text with default values for various options.
172a7398723SShteryana Shopova.It Fl I Ar options
173a7398723SShteryana ShopovaLoad each MIB description file from the given list to translate symbolic
174a7398723SShteryana Shopovaobject names to their numerical representation and vice versa.
175a7398723SShteryana ShopovaUse the other options to obtain a non-default behaviour:
176f0720ed5SUlrich Spörlein.Bl -tag -width \&
177a7398723SShteryana Shopova.It Cm cut=OID
178a7398723SShteryana ShopovaSpecifies the initial OID that was cut by
179a7398723SShteryana Shopova.Xr gensnmpdef 1
180a7398723SShteryana Shopovawhen producing the MIB description file.
181a7398723SShteryana ShopovaThe default value is .iso(1).org(3).dod(6) which is what should have been
182550c00acSChristian Bruefferused for all the files installed under
183550c00acSChristian Brueffer.Pa /usr/share/snmp/defs .
184f0720ed5SUlrich SpörleinUse this only if you generated your own files, providing a
185f0720ed5SUlrich Spörlein.Fl c
186f0720ed5SUlrich Spörleinoption to
187a7398723SShteryana Shopova.Xr gensnmpdef 1 .
188a7398723SShteryana Shopova.It Cm path=filedir
189a7398723SShteryana ShopovaThe directory where files in the list will be searched.
190a7398723SShteryana ShopovaThe default is
191f0720ed5SUlrich Spörlein.Pa /usr/share/snmp/defs Ns .
192a7398723SShteryana Shopova.It Cm file=filelist
193a7398723SShteryana ShopovaA comma separated list of files to which the two options above will apply.
194a7398723SShteryana Shopova.El
195a7398723SShteryana Shopova.Pp
196a7398723SShteryana ShopovaThe file suboption has to come after the other suboptions so that their
197a7398723SShteryana Shopovanon-default values will be applied to the list of files.
198a7398723SShteryana ShopovaThe order of the other suboptions before each file suboption can be random.
199a7398723SShteryana ShopovaSuboptions may be separated either by commas or by spaces.
200a7398723SShteryana ShopovaIf using spaces make sure the entire option string is one argument, for
201a7398723SShteryana Shopovaexample using quotes.
202a7398723SShteryana Shopova.It Fl i Ar filelist
203a7398723SShteryana ShopovaList of MIB description files produced by
204550c00acSChristian Brueffer.Xr gensnmpdef 1
205550c00acSChristian Bruefferwhich
206a7398723SShteryana Shopova.Nm bsnmpget ,
207a7398723SShteryana Shopova.Nm bsnmpwalk
208a7398723SShteryana Shopovaor
209a7398723SShteryana Shopova.Nm bsnmpset
210a7398723SShteryana Shopovawill search to translate numerical OIDs to their symbolic object names.
211a7398723SShteryana ShopovaMultiple files can be provided either giving this option multiple times
212a7398723SShteryana Shopovaor a comma separated list of file names.
213a7398723SShteryana ShopovaIf a filename begins with a letter the default directory,
214550c00acSChristian Brueffer.Pa /usr/share/snmp/defs ,
215a7398723SShteryana Shopovawill be searched.
216a7398723SShteryana Shopova.It Fl K
217a7398723SShteryana ShopovaCalculate and display the localized authentication and privacy keys
218550c00acSChristian Brueffercorresponding to a plain text password.
219550c00acSChristian BruefferThe password is obtained via the environment.
220550c00acSChristian BruefferAdditionally, if one or more OIDs are specified, the calculated
221a7398723SShteryana Shopovakeys are used when processing the SNMPv3 requests.
222a7398723SShteryana Shopova.It Fl l Ar filename
223a7398723SShteryana ShopovaThe path of the posix local (unix domain) socket if local
224a7398723SShteryana Shopovatransport is used.
225a7398723SShteryana Shopova.It Fl M Ar max-repetitions
226a7398723SShteryana ShopovaThe value for the max-repetitions field in a GetBulk PDU.
227b9288caaSShteryana ShopovaDefault is 10.
228a7398723SShteryana Shopova.It Fl N Ar non-repeaters
229a7398723SShteryana ShopovaThe value for the non-repeaters field in a GetBulk PDU.
230a7398723SShteryana ShopovaDefault is 0.
231a7398723SShteryana Shopova.It Fl n
232a7398723SShteryana ShopovaOnly use numerical representations for input and output OIDs and do not
233a7398723SShteryana Shopovatry to resolve symbolic object names.
234a7398723SShteryana ShopovaNote that
235a7398723SShteryana Shopova.Nm bsnmpget ,
236a7398723SShteryana Shopova.Nm bsnmpwalk
237a7398723SShteryana Shopovaand
238a7398723SShteryana Shopova.Nm bsnmpset
239a7398723SShteryana Shopovawill print numerical OIDs anyway if the corresponding string representation
240a7398723SShteryana Shopovais not found in the MIB description files.
241a7398723SShteryana Shopova.It Fl o Ar [quiet|short|verbose]
242a7398723SShteryana ShopovaThe format used to print the received response.
243a7398723SShteryana ShopovaQuiet only prints values, short (default) prints an abbreviated OID
244a7398723SShteryana Shopovarepresentation and the value.
245a7398723SShteryana ShopovaIn addition to the short output verbose prints the type before the value.
246a7398723SShteryana Shopova.It Fl P Ar options
247a7398723SShteryana ShopovaPrivacy options to use with SNMPv3 PDUs
248f0720ed5SUlrich Spörlein.Bl -tag -width \&
249a7398723SShteryana Shopova.It Cm proto=[aes|des]
250550c00acSChristian BruefferThe protocol to use when encrypting/decrypting SNMPv3 PDU data.
251a7398723SShteryana Shopova.It Cm key=privkey
252550c00acSChristian BruefferA binary localized privacy key to use when encrypting/decrypting SNMPv3 PDU data.
253a7398723SShteryana Shopova.El
254a7398723SShteryana Shopova.Pp
255a7398723SShteryana ShopovaBy default plain text SNMPv3 PDUs are sent.
256a7398723SShteryana Shopova.It Fl p Ar [get|getnext|getbulk]
257a7398723SShteryana ShopovaThe PDU type to send by
258b9288caaSShteryana Shopova.Nm bsmpget
259b9288caaSShteryana Shopovaand
260b9288caaSShteryana Shopova.Nm bsnmpwalk .
261b9288caaSShteryana ShopovaDefault is get
262b9288caaSShteryana Shopovafor
263b9288caaSShteryana Shopova.Nm bsmpget
264b9288caaSShteryana Shopovaand getnext for
265b9288caaSShteryana Shopova.Nm bsnmpwalk .
266b9288caaSShteryana ShopovaGetbulk allows executing the so called SNMP "bulkwalks" allowing the values of
2672063b2c0SJoel Dahlmultiple columns to be retrieved in a single PDU by
268b9288caaSShteryana Shopova.Nm bsnmpwalk .
269a7398723SShteryana Shopova.It Fl r Ar retries
270a7398723SShteryana ShopovaNumber of resends of request packets before giving up if the agent does
271a7398723SShteryana Shopovanot respond after the first try.
272a7398723SShteryana ShopovaDefault is 3.
273a7398723SShteryana Shopova.It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port]
274a7398723SShteryana ShopovaEach of the server specification components is optional but at least one
275550c00acSChristian Bruefferhas to be provided if the
276f0720ed5SUlrich Spörlein.Ar s
277f0720ed5SUlrich Spörleinoption is used.
278a7398723SShteryana ShopovaThe server specification is constructed in the following manner:
279f0720ed5SUlrich Spörlein.Bl -tag -width \&
280a7398723SShteryana Shopova.It Cm trans::
281a7398723SShteryana ShopovaTransport type may be one of udp, stream or dgram.
282550c00acSChristian BruefferIf this option is not provided an UDP inet/inet6 socket will be used, which
283a7398723SShteryana Shopovais the most common.
284a7398723SShteryana ShopovaStream stands for a posix local stream socket and a posix local datagram
285a7398723SShteryana Shopovasocket will be used if dgram is specified.
286a7398723SShteryana Shopova.It Cm community@
287a7398723SShteryana ShopovaSpecify an SNMP community string to be used when sending packets.
288a7398723SShteryana ShopovaIf the option is skipped the default "public" will be used for
289a7398723SShteryana Shopova.Nm
290a7398723SShteryana Shopovaand
291a7398723SShteryana Shopova.Nm bsnmpwalk
292a7398723SShteryana Shopovaand the default "private" community string will be used for
293a7398723SShteryana Shopova.Nm bsnmpset .
294a7398723SShteryana Shopova.It Cm server
295a7398723SShteryana ShopovaThis might be either the IP address or the hostname where the agent is
296a7398723SShteryana Shopovalistening.
297f0720ed5SUlrich SpörleinThe default is
298f0720ed5SUlrich Spörlein.Qq localhost .
299a7398723SShteryana Shopova.It Cm port
300a7398723SShteryana ShopovaThe destination port to send the requests to.
301a7398723SShteryana ShopovaThis is useful if the SNMP agent listens on a non-default port.
302f0720ed5SUlrich SpörleinDefault is given by the
303f0720ed5SUlrich Spörlein.Qq snmp
304f0720ed5SUlrich Spörleinentry in
305f0720ed5SUlrich Spörlein.Pa /etc/services ,
306f0720ed5SUlrich Spörleinport 161.
307a7398723SShteryana Shopova.El
308a7398723SShteryana Shopova.It Fl t Ar timeout
309a7398723SShteryana ShopovaNumber of seconds before resending a request packet if the agent does
310a7398723SShteryana Shopovanot respond.
311a7398723SShteryana ShopovaThe default value is 3 seconds.
312a7398723SShteryana Shopova.It Fl U Ar options
313a7398723SShteryana ShopovaUser credentials when sending SNMPv3 PDUs.
314f0720ed5SUlrich Spörlein.Bl -tag -width \&
315a7398723SShteryana Shopova.It Cm engine=id
316a7398723SShteryana ShopovaThe Engine ID of the SNMP agent represented as a binary octet string.
317a7398723SShteryana Shopova.It Cm engine-boots=value
318a7398723SShteryana ShopovaThe value of the snmpEngineBoots of the SNMP agent.
319a7398723SShteryana Shopova.It Cm engine-time=value
320a7398723SShteryana ShopovaThe value of the snmpEngineTime of the SNMP agent.
321a7398723SShteryana Shopova.Pp
322a7398723SShteryana ShopovaIf any of the above is not specified, SNMP USM Engine Discovery is attempted.
323a7398723SShteryana ShopovaThis is also the default behavior.
324a7398723SShteryana Shopova.It Cm name=username
325550c00acSChristian BruefferThe USM user name to include in the SNMPv3 PDUs.
326550c00acSChristian BruefferBy default, the user name is
327550c00acSChristian Bruefferobtained via the environment.
328a7398723SShteryana Shopova.El
329a7398723SShteryana Shopova.It Fl v Ar version
330550c00acSChristian BruefferThe SNMP protocol version to use when sending requests.
331550c00acSChristian BruefferSNMP versions 1, 2 and
332a7398723SShteryana Shopova3 are supported.
333a7398723SShteryana ShopovaIf no version option is provided
334a7398723SShteryana Shopova.Nm bsnmpget ,
335a7398723SShteryana Shopova.Nm bsnmpwalk
336a7398723SShteryana Shopovaand
337a7398723SShteryana Shopova.Nm bsnmpset
338a7398723SShteryana Shopovawill use version 2.
339a7398723SShteryana ShopovaNote that GetBulkRequest-PDUs were introduced in SNMPv2 thus setting the
340550c00acSChristian Bruefferversion to 1 is incompatible with sending a GetBulk PDU.
341a7398723SShteryana Shopova.It OID
3422063b2c0SJoel DahlThe object identifier whose value to retrieve.
343a7398723SShteryana ShopovaAt least one OID should be provided for
344a7398723SShteryana Shopova.Nm bsnmpget
345a7398723SShteryana Shopovato be able to send a request.
346a7398723SShteryana Shopova.Pp
347a7398723SShteryana ShopovaFor
348a7398723SShteryana Shopova.Nm bsnmpwalk
349a7398723SShteryana Shopovathis is the root object identifier of the subtree whose values are to be
3502063b2c0SJoel Dahlretrieved.
351a7398723SShteryana ShopovaIf no OID is provided
352a7398723SShteryana Shopova.Nm bsnmpwalk
353a7398723SShteryana Shopovawill walk the mib2 subtree rooted
354a7398723SShteryana Shopovaat .iso(1).org(3).dod(6).internet(1).mgmt(2).mib2(1) .
355a7398723SShteryana Shopova.Pp
356a7398723SShteryana ShopovaAny of the formats used to print a single variable
357a7398723SShteryana Shopovais valid as input OID:
358f0720ed5SUlrich Spörlein.Bl -tag -width \&
359a7398723SShteryana Shopova.It 1.3.6.1.2.1.25.1.1.0
360a7398723SShteryana Shopova.It sysDescr
361a7398723SShteryana Shopova.It ifPhysAddress.1
362a7398723SShteryana Shopova.It ifRcvAddressStatus.2.6.255.255.255.255.255.255
363a7398723SShteryana Shopova.It ifRcvAddressType[2,ff:ff:ff:ff:ff:ff]
364a7398723SShteryana Shopova.It ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]
365550c00acSChristian Brueffer(requires the
366f0720ed5SUlrich Spörlein.Fl o Ar verbose
367f0720ed5SUlrich Spörleinoption)
368a7398723SShteryana Shopova.El
369a7398723SShteryana Shopova.Pp
370a7398723SShteryana ShopovaSquare brackets are used to denote an entry's indexes.
371a7398723SShteryana ShopovaWhen used in an input OID, the square brackets may have to be
372a7398723SShteryana Shopovaescaped or the OID has to be quoted to protect it from the shell.
373a7398723SShteryana ShopovaNote there is no difference between ifName.1 and "ifName[1]".
374a7398723SShteryana Shopova.It OID Ns = Ns Ar [syntax Ns :] Ns Ar value
375a7398723SShteryana ShopovaThe object identifier with its syntax type and value that is to be set.
376a7398723SShteryana ShopovaAt least one such string OID=[syntax:]value should be provided to
377a7398723SShteryana Shopova.Nm bsnmpset
378a7398723SShteryana Shopovato be able to send a request.
379f0720ed5SUlrich Spörlein.Bl -tag -width \&
380a7398723SShteryana Shopova.It Cm OID
381a7398723SShteryana ShopovaOID may be input as a string, a string followed by a random number of integers
382a7398723SShteryana Shopova(suboids) separated by dots, a sequence of integers separated by dots - that is
383550c00acSChristian Bruefferif the
384f0720ed5SUlrich Spörlein.Ar n
385550c00acSChristian Bruefferoption is used - and in such case a syntax is required for every value,
386a7398723SShteryana Shopovaor a string followed by square brackets (used to denote an entry's indexes) and
387a7398723SShteryana Shopovacorresponding indexes.
388550c00acSChristian BruefferAny of the formats used to print a single variable by
389550c00acSChristian Brueffer.Nm bsnmpset
390550c00acSChristian Bruefferis valid as input OID as well:
391f0720ed5SUlrich Spörlein.Bl -tag -width \&
392a7398723SShteryana Shopova.It 1.3.6.1.2.1.25.1.1.0=TimeTicks:537615486
393f0720ed5SUlrich Spörlein.It sysLocation=OctetString:"@ Home" (with Fl o Ar verbose No option)
394a7398723SShteryana Shopova.It sysLocation.0="@ Home"
395a7398723SShteryana Shopova.It 1.3.6.1.2.1.2.2.1.6.1=OctetString:ffffffffffff
396a7398723SShteryana Shopova.It ifPhysAddress.1="00:02:b3:1d:1c:a3"
397a7398723SShteryana Shopova.It ifRcvAddressStatus.1.6.255.255.255.255.255.255=1
398a7398723SShteryana Shopova.It "ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]=Integer:1"
399550c00acSChristian Brueffer(with the
400f0720ed5SUlrich Spörlein.Fl o Ar verbose
401f0720ed5SUlrich Spörleinoption)
402a7398723SShteryana Shopova.El
403a7398723SShteryana Shopova.It Cm syntax
404550c00acSChristian Bruefferwhere the syntax string is one of:
405a7398723SShteryana ShopovaInteger, OctetString, OID, IpAddress, Counter32, Gauge, TimeTicks, Counter64.
406a7398723SShteryana Shopova.It Cm value
407a7398723SShteryana ShopovaThe value to be set - IP address in form of u.u.u.u - for example
408a7398723SShteryana Shopova1.3.1.6.1.2.0=IpAddress:192.168.0.1, strings require inverted-commas if they
409550c00acSChristian Brueffercontain any special characters or spaces, all other numeric types do not.
410a7398723SShteryana Shopova.El
411f0720ed5SUlrich Spörlein.El
412a7398723SShteryana Shopova.Sh ENVIRONMENT
413a7398723SShteryana Shopova.Nm ,
414a7398723SShteryana Shopova.Nm bsnmpwalk
415a7398723SShteryana Shopovaand
416a7398723SShteryana Shopova.Nm bsnmpset
417a7398723SShteryana Shopovause the following environment variables:
418a7398723SShteryana Shopova.Bl -tag -width SNMPAUTH
419a7398723SShteryana Shopova.It Ev SNMPAUTH
420a7398723SShteryana ShopovaSpecifies a default SNMP USM authentication protocol.
421a7398723SShteryana Shopova.It Ev SNMPPRIV
422a7398723SShteryana ShopovaSpecifies a default SNMP USM privacy protocol.
423a7398723SShteryana Shopova.It Ev SNMPUSER
424a7398723SShteryana ShopovaSpecifies a default SNMP USM user name.
425a7398723SShteryana Shopova.It Ev SNMPPASSWD
426a7398723SShteryana ShopovaSpecifies the SNMP USM plain text password to use when calculating localized
427550c00acSChristian Bruefferauthentication and privacy keys.
428550c00acSChristian BruefferIf this variable exists in the environment,
429550c00acSChristian BruefferSNMPv3 is the default version to use for outgoing requests.
430f0720ed5SUlrich Spörlein.El
431a7398723SShteryana Shopova.Sh SEE ALSO
432a7398723SShteryana Shopova.Xr gensnmpdef 1
433a7398723SShteryana Shopova.Sh AUTHORS
43401c2b8acSBaptiste Daroussin.An Shteryana Shopova Aq Mt syrinx@FreeBSD.org
435