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.\" 34b9288caaSShteryana Shopova.Dd January 10, 2012 35a7398723SShteryana Shopova.Dt BSNMPGET 1 36a7398723SShteryana Shopova.Os 37a7398723SShteryana Shopova.Sh NAME 38a7398723SShteryana Shopova.Nm bsnmpget , 39a7398723SShteryana Shopova.Nm bsnmpwalk , 40a7398723SShteryana Shopova.Nm bsnmpset 41a7398723SShteryana Shopova.Nd "simple tools for querying SNMP agents" 42a7398723SShteryana Shopova.Sh SYNOPSIS 43a7398723SShteryana Shopova.Nm 44a7398723SShteryana Shopova.Op Fl aDdehnK 45a7398723SShteryana Shopova.Op Fl A Ar options 46a7398723SShteryana Shopova.Op Fl b Ar buffersize 47a7398723SShteryana Shopova.Op Fl C Ar options 48a7398723SShteryana Shopova.Op Fl I Ar options 49a7398723SShteryana Shopova.Op Fl i Ar filelist 50a7398723SShteryana Shopova.Op Fl l Ar filename 51a7398723SShteryana Shopova.Op Fl M Ar max-repetitions 52a7398723SShteryana Shopova.Op Fl N Ar non-repeaters 53a7398723SShteryana Shopova.Op Fl o Ar output 54a7398723SShteryana Shopova.Op Fl P Ar options 55a7398723SShteryana Shopova.Op Fl p Ar pdu 56a7398723SShteryana Shopova.Op Fl r Ar retries 57a7398723SShteryana Shopova.Op Fl s Ar [trans::][community@][server][:port] 58a7398723SShteryana Shopova.Op Fl t Ar timeout 59a7398723SShteryana Shopova.Op Fl U Ar options 60a7398723SShteryana Shopova.Op Fl v Ar version 61a7398723SShteryana Shopova.Op Ar OID ... 62a7398723SShteryana Shopova.Pp 63a7398723SShteryana Shopova.Nm bsnmpwalk 64a7398723SShteryana Shopova.Op Fl dhnK 65a7398723SShteryana Shopova.Op Fl A Ar options 66a7398723SShteryana Shopova.Op Fl b Ar buffersize 67a7398723SShteryana Shopova.Op Fl C Ar options 68a7398723SShteryana Shopova.Op Fl I Ar options 69a7398723SShteryana Shopova.Op Fl i Ar filelist 70a7398723SShteryana Shopova.Op Fl l Ar filename 71a7398723SShteryana Shopova.Op Fl o Ar output 72a7398723SShteryana Shopova.Op Fl P Ar options 73a7398723SShteryana Shopova.Op Fl r Ar retries 74a7398723SShteryana Shopova.Op Fl s Ar [trans::][community@][server][:port] 75a7398723SShteryana Shopova.Op Fl t Ar timeout 76a7398723SShteryana Shopova.Op Fl U Ar options 77a7398723SShteryana Shopova.Op Fl v Ar version 78a7398723SShteryana Shopova.Op Ar OID ... 79a7398723SShteryana Shopova.Pp 80a7398723SShteryana Shopova.Nm bsnmpset 81a7398723SShteryana Shopova.Op Fl adehnK 82a7398723SShteryana Shopova.Op Fl A Ar options 83a7398723SShteryana Shopova.Op Fl b Ar buffersize 84a7398723SShteryana Shopova.Op Fl C Ar options 85a7398723SShteryana Shopova.Op Fl I Ar options 86a7398723SShteryana Shopova.Op Fl i Ar filelist 87a7398723SShteryana Shopova.Op Fl l Ar filename 88a7398723SShteryana Shopova.Op Fl o Ar output 89a7398723SShteryana Shopova.Op Fl P Ar options 90a7398723SShteryana Shopova.Op Fl r Ar retries 91a7398723SShteryana Shopova.Op Fl s Ar [trans::][community@][server][:port] 92a7398723SShteryana Shopova.Op Fl t Ar timeout 93a7398723SShteryana Shopova.Op Fl U Ar options 94a7398723SShteryana Shopova.Op Fl v Ar version 95a7398723SShteryana Shopova.Ar OID Ns = Ar syntax Ns : Ns Ar value 96a7398723SShteryana Shopova.Op Ar OID Ns = Ar syntax Ns : Ns Ar value ... 97a7398723SShteryana Shopova.Sh DESCRIPTION 98a7398723SShteryana Shopova.Nm , 99a7398723SShteryana Shopova.Nm bsnmpwalk 100a7398723SShteryana Shopovaand 101a7398723SShteryana Shopova.Nm bsnmpset 102a7398723SShteryana Shopovaare simple tools for retrieving management information from and setting 1033df5ecacSUlrich Spörleinmanagement information to a Simple Network Management Protocol (SNMP) agent. 104a7398723SShteryana Shopova.Pp 105a7398723SShteryana ShopovaDepending on the options 106a7398723SShteryana Shopova.Nm bsnmpget 107550c00acSChristian Bruefferconstructs either a SNMP GetRequest, GetNextRequest 108a7398723SShteryana Shopovaor a GetBulkRequest packet, fills in the object identifiers (OIDs) of the 1092063b2c0SJoel Dahlobjects whose values will be retrieved, waits for a response and prints it if 110a7398723SShteryana Shopovareceived successfully. 111a7398723SShteryana Shopova.Pp 112a7398723SShteryana Shopova.Nm Bsnmpwalk 113550c00acSChristian Bruefferqueries an agent with ether SNMP GetNextRequest or GetBulkRequest packets, 114a7398723SShteryana Shopovaasking for values of OID instances that are a part of the object subtree 115a7398723SShteryana Shopovarooted at the provided OIDs. 116a7398723SShteryana Shopova.Pp 117a7398723SShteryana Shopova.Nm Bsnmpset 118550c00acSChristian Bruefferconstructs a SNMP SetRequest packet, fills in the OIDs (object identifiers), 119a7398723SShteryana Shopovasyntaxes and values of the objects whose values are to be set and waits for a 1203df5ecacSUlrich Spörleinresponse from server. 121a7398723SShteryana Shopova.Sh OPTIONS 122a7398723SShteryana ShopovaThe options are as follows (not all apply to all three programs): 123a7398723SShteryana Shopova.Bl -tag -width ".It Fl D Ar options" 124a7398723SShteryana Shopova.It Fl A Ar options 125a7398723SShteryana ShopovaAuthentication options to use with SNMPv3 PDUs 126f0720ed5SUlrich Spörlein.Bl -tag -width \& 127a7398723SShteryana Shopova.It Cm proto=[md5|sha] 128a7398723SShteryana ShopovaThe protocol to use when calculating the PDU message digest. 129a7398723SShteryana Shopova.It Cm key=authkey 130a7398723SShteryana ShopovaA binary localized authentication key to use when calculating the PDU message 131a7398723SShteryana Shopovadigest. 132a7398723SShteryana Shopova.El 133a7398723SShteryana Shopova.Pp 134a7398723SShteryana ShopovaBy default SNMPv3 PDUs are sent unauthenticated. 135a7398723SShteryana Shopova.It Fl a 136a7398723SShteryana ShopovaSkip any sanity checks when adding OIDs to a Protocol Data Unit (PDU): 1377a184a41SGordon Berglingignore syntax/access type, allow adding of non-leaf objects for GetPdu and 138a7398723SShteryana Shopovaread-only objects to a SetPDU. 139a7398723SShteryana Shopova.It Fl b Ar buffersize 140a7398723SShteryana ShopovaTune the size of buffers used to send and receive packets. 141a7398723SShteryana ShopovaThe default size is 10000 bytes which should be enough unless an agent sends 142a7398723SShteryana Shopovaa really large octetstring. 143a7398723SShteryana ShopovaThe maximum allowed length is 65535 according to the Structure of Management 144a7398723SShteryana ShopovaInformation (SMIv2). 145a7398723SShteryana Shopova.It Fl C Ar options 146a7398723SShteryana ShopovaThe context to query with SNMPv3 PDUs. 147f0720ed5SUlrich Spörlein.Bl -tag -width \& 148a7398723SShteryana Shopova.It Cm context=name 1493d265fceSGordon BerglingThe context name. 1503d265fceSGordon BerglingDefault is "" (empty). 151a7398723SShteryana Shopova.It Cm context-engine=engine-id 152a7398723SShteryana ShopovaThe SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as 153550c00acSChristian Bruefferbinary octet string. 154550c00acSChristian BruefferBy default, this is set to the Engine ID of the SNMP agent. 155a7398723SShteryana Shopova.El 156a7398723SShteryana Shopova.It Fl D 157a7398723SShteryana ShopovaPerform SNMP USM Engine Discovery, rather than sending a request for the value 158a7398723SShteryana Shopovaof a specific object. 159a7398723SShteryana Shopova.It Fl d 160a7398723SShteryana ShopovaTurn on debugging. 161a7398723SShteryana ShopovaThis option will cause the packets sent and received to be dumped to the 162a7398723SShteryana Shopovaterminal. 163a7398723SShteryana Shopova.It Fl e 164a7398723SShteryana ShopovaRetry on error. 165a7398723SShteryana ShopovaIf an error is returned in the response PDU, resend the request removing the 166a7398723SShteryana Shopovavariable that caused the error until a valid response is received. 1673df5ecacSUlrich SpörleinThis is only useful for a GetRequest- and a GetNextRequest-PDU. 168a7398723SShteryana Shopova.It Fl h 169a7398723SShteryana ShopovaPrint a short help text with default values for various options. 170a7398723SShteryana Shopova.It Fl I Ar options 171a7398723SShteryana ShopovaLoad each MIB description file from the given list to translate symbolic 172a7398723SShteryana Shopovaobject names to their numerical representation and vice versa. 173a7398723SShteryana ShopovaUse the other options to obtain a non-default behaviour: 174f0720ed5SUlrich Spörlein.Bl -tag -width \& 175a7398723SShteryana Shopova.It Cm cut=OID 176a7398723SShteryana ShopovaSpecifies the initial OID that was cut by 177a7398723SShteryana Shopova.Xr gensnmpdef 1 178a7398723SShteryana Shopovawhen producing the MIB description file. 179a7398723SShteryana ShopovaThe default value is .iso(1).org(3).dod(6) which is what should have been 180550c00acSChristian Bruefferused for all the files installed under 181550c00acSChristian Brueffer.Pa /usr/share/snmp/defs . 182f0720ed5SUlrich SpörleinUse this only if you generated your own files, providing a 183f0720ed5SUlrich Spörlein.Fl c 184f0720ed5SUlrich Spörleinoption to 185a7398723SShteryana Shopova.Xr gensnmpdef 1 . 186a7398723SShteryana Shopova.It Cm path=filedir 187a7398723SShteryana ShopovaThe directory where files in the list will be searched. 188a7398723SShteryana ShopovaThe default is 189f0720ed5SUlrich Spörlein.Pa /usr/share/snmp/defs Ns . 190a7398723SShteryana Shopova.It Cm file=filelist 191a7398723SShteryana ShopovaA comma separated list of files to which the two options above will apply. 192a7398723SShteryana Shopova.El 193a7398723SShteryana Shopova.Pp 194a7398723SShteryana ShopovaThe file suboption has to come after the other suboptions so that their 195a7398723SShteryana Shopovanon-default values will be applied to the list of files. 196a7398723SShteryana ShopovaThe order of the other suboptions before each file suboption can be random. 197a7398723SShteryana ShopovaSuboptions may be separated either by commas or by spaces. 198a7398723SShteryana ShopovaIf using spaces make sure the entire option string is one argument, for 199a7398723SShteryana Shopovaexample using quotes. 200a7398723SShteryana Shopova.It Fl i Ar filelist 201a7398723SShteryana ShopovaList of MIB description files produced by 202550c00acSChristian Brueffer.Xr gensnmpdef 1 203550c00acSChristian Bruefferwhich 204a7398723SShteryana Shopova.Nm bsnmpget , 205a7398723SShteryana Shopova.Nm bsnmpwalk 206a7398723SShteryana Shopovaor 207a7398723SShteryana Shopova.Nm bsnmpset 208a7398723SShteryana Shopovawill search to translate numerical OIDs to their symbolic object names. 209a7398723SShteryana ShopovaMultiple files can be provided either giving this option multiple times 210a7398723SShteryana Shopovaor a comma separated list of file names. 211a7398723SShteryana ShopovaIf a filename begins with a letter the default directory, 212550c00acSChristian Brueffer.Pa /usr/share/snmp/defs , 213a7398723SShteryana Shopovawill be searched. 214a7398723SShteryana Shopova.It Fl K 215a7398723SShteryana ShopovaCalculate and display the localized authentication and privacy keys 216550c00acSChristian Brueffercorresponding to a plain text password. 217550c00acSChristian BruefferThe password is obtained via the environment. 218550c00acSChristian BruefferAdditionally, if one or more OIDs are specified, the calculated 219a7398723SShteryana Shopovakeys are used when processing the SNMPv3 requests. 220a7398723SShteryana Shopova.It Fl l Ar filename 221a7398723SShteryana ShopovaThe path of the posix local (unix domain) socket if local 222a7398723SShteryana Shopovatransport is used. 223a7398723SShteryana Shopova.It Fl M Ar max-repetitions 224a7398723SShteryana ShopovaThe value for the max-repetitions field in a GetBulk PDU. 225b9288caaSShteryana ShopovaDefault is 10. 226a7398723SShteryana Shopova.It Fl N Ar non-repeaters 227a7398723SShteryana ShopovaThe value for the non-repeaters field in a GetBulk PDU. 228a7398723SShteryana ShopovaDefault is 0. 229a7398723SShteryana Shopova.It Fl n 230a7398723SShteryana ShopovaOnly use numerical representations for input and output OIDs and do not 231a7398723SShteryana Shopovatry to resolve symbolic object names. 232a7398723SShteryana ShopovaNote that 233a7398723SShteryana Shopova.Nm bsnmpget , 234a7398723SShteryana Shopova.Nm bsnmpwalk 235a7398723SShteryana Shopovaand 236a7398723SShteryana Shopova.Nm bsnmpset 237a7398723SShteryana Shopovawill print numerical OIDs anyway if the corresponding string representation 238a7398723SShteryana Shopovais not found in the MIB description files. 239a7398723SShteryana Shopova.It Fl o Ar [quiet|short|verbose] 240a7398723SShteryana ShopovaThe format used to print the received response. 241a7398723SShteryana ShopovaQuiet only prints values, short (default) prints an abbreviated OID 242a7398723SShteryana Shopovarepresentation and the value. 243a7398723SShteryana ShopovaIn addition to the short output verbose prints the type before the value. 244a7398723SShteryana Shopova.It Fl P Ar options 245a7398723SShteryana ShopovaPrivacy options to use with SNMPv3 PDUs 246f0720ed5SUlrich Spörlein.Bl -tag -width \& 247a7398723SShteryana Shopova.It Cm proto=[aes|des] 248550c00acSChristian BruefferThe protocol to use when encrypting/decrypting SNMPv3 PDU data. 249a7398723SShteryana Shopova.It Cm key=privkey 250550c00acSChristian BruefferA binary localized privacy key to use when encrypting/decrypting SNMPv3 PDU data. 251a7398723SShteryana Shopova.El 252a7398723SShteryana Shopova.Pp 253a7398723SShteryana ShopovaBy default plain text SNMPv3 PDUs are sent. 254a7398723SShteryana Shopova.It Fl p Ar [get|getnext|getbulk] 255a7398723SShteryana ShopovaThe PDU type to send by 256b9288caaSShteryana Shopova.Nm bsmpget 257b9288caaSShteryana Shopovaand 258b9288caaSShteryana Shopova.Nm bsnmpwalk . 259b9288caaSShteryana ShopovaDefault is get 260b9288caaSShteryana Shopovafor 261b9288caaSShteryana Shopova.Nm bsmpget 262b9288caaSShteryana Shopovaand getnext for 263b9288caaSShteryana Shopova.Nm bsnmpwalk . 264b9288caaSShteryana ShopovaGetbulk allows executing the so called SNMP "bulkwalks" allowing the values of 2652063b2c0SJoel Dahlmultiple columns to be retrieved in a single PDU by 266b9288caaSShteryana Shopova.Nm bsnmpwalk . 267a7398723SShteryana Shopova.It Fl r Ar retries 268a7398723SShteryana ShopovaNumber of resends of request packets before giving up if the agent does 269a7398723SShteryana Shopovanot respond after the first try. 270a7398723SShteryana ShopovaDefault is 3. 271a7398723SShteryana Shopova.It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port] 272a7398723SShteryana ShopovaEach of the server specification components is optional but at least one 273550c00acSChristian Bruefferhas to be provided if the 274f0720ed5SUlrich Spörlein.Ar s 275f0720ed5SUlrich Spörleinoption is used. 276a7398723SShteryana ShopovaThe server specification is constructed in the following manner: 277f0720ed5SUlrich Spörlein.Bl -tag -width \& 278a7398723SShteryana Shopova.It Cm trans:: 279a7398723SShteryana ShopovaTransport type may be one of udp, stream or dgram. 280550c00acSChristian BruefferIf this option is not provided an UDP inet/inet6 socket will be used, which 281a7398723SShteryana Shopovais the most common. 282a7398723SShteryana ShopovaStream stands for a posix local stream socket and a posix local datagram 283a7398723SShteryana Shopovasocket will be used if dgram is specified. 284a7398723SShteryana Shopova.It Cm community@ 285a7398723SShteryana ShopovaSpecify an SNMP community string to be used when sending packets. 286a7398723SShteryana ShopovaIf the option is skipped the default "public" will be used for 287a7398723SShteryana Shopova.Nm 288a7398723SShteryana Shopovaand 289a7398723SShteryana Shopova.Nm bsnmpwalk 290a7398723SShteryana Shopovaand the default "private" community string will be used for 291a7398723SShteryana Shopova.Nm bsnmpset . 292a7398723SShteryana Shopova.It Cm server 293a7398723SShteryana ShopovaThis might be either the IP address or the hostname where the agent is 294a7398723SShteryana Shopovalistening. 295f0720ed5SUlrich SpörleinThe default is 296f0720ed5SUlrich Spörlein.Qq localhost . 297a7398723SShteryana Shopova.It Cm port 298a7398723SShteryana ShopovaThe destination port to send the requests to. 299a7398723SShteryana ShopovaThis is useful if the SNMP agent listens on a non-default port. 300f0720ed5SUlrich SpörleinDefault is given by the 301f0720ed5SUlrich Spörlein.Qq snmp 302f0720ed5SUlrich Spörleinentry in 303f0720ed5SUlrich Spörlein.Pa /etc/services , 304f0720ed5SUlrich Spörleinport 161. 305a7398723SShteryana Shopova.El 306a7398723SShteryana Shopova.It Fl t Ar timeout 307a7398723SShteryana ShopovaNumber of seconds before resending a request packet if the agent does 308a7398723SShteryana Shopovanot respond. 309a7398723SShteryana ShopovaThe default value is 3 seconds. 310a7398723SShteryana Shopova.It Fl U Ar options 311a7398723SShteryana ShopovaUser credentials when sending SNMPv3 PDUs. 312f0720ed5SUlrich Spörlein.Bl -tag -width \& 313a7398723SShteryana Shopova.It Cm engine=id 314a7398723SShteryana ShopovaThe Engine ID of the SNMP agent represented as a binary octet string. 315a7398723SShteryana Shopova.It Cm engine-boots=value 316a7398723SShteryana ShopovaThe value of the snmpEngineBoots of the SNMP agent. 317a7398723SShteryana Shopova.It Cm engine-time=value 318a7398723SShteryana ShopovaThe value of the snmpEngineTime of the SNMP agent. 319a7398723SShteryana Shopova.Pp 320a7398723SShteryana ShopovaIf any of the above is not specified, SNMP USM Engine Discovery is attempted. 321a7398723SShteryana ShopovaThis is also the default behavior. 322a7398723SShteryana Shopova.It Cm name=username 323550c00acSChristian BruefferThe USM user name to include in the SNMPv3 PDUs. 324550c00acSChristian BruefferBy default, the user name is 325550c00acSChristian Bruefferobtained via the environment. 326a7398723SShteryana Shopova.El 327a7398723SShteryana Shopova.It Fl v Ar version 328550c00acSChristian BruefferThe SNMP protocol version to use when sending requests. 329550c00acSChristian BruefferSNMP versions 1, 2 and 330a7398723SShteryana Shopova3 are supported. 331a7398723SShteryana ShopovaIf no version option is provided 332a7398723SShteryana Shopova.Nm bsnmpget , 333a7398723SShteryana Shopova.Nm bsnmpwalk 334a7398723SShteryana Shopovaand 335a7398723SShteryana Shopova.Nm bsnmpset 336a7398723SShteryana Shopovawill use version 2. 337a7398723SShteryana ShopovaNote that GetBulkRequest-PDUs were introduced in SNMPv2 thus setting the 338550c00acSChristian Bruefferversion to 1 is incompatible with sending a GetBulk PDU. 339a7398723SShteryana Shopova.It OID 3402063b2c0SJoel DahlThe object identifier whose value to retrieve. 341a7398723SShteryana ShopovaAt least one OID should be provided for 342a7398723SShteryana Shopova.Nm bsnmpget 343a7398723SShteryana Shopovato be able to send a request. 344a7398723SShteryana Shopova.Pp 345a7398723SShteryana ShopovaFor 346a7398723SShteryana Shopova.Nm bsnmpwalk 347a7398723SShteryana Shopovathis is the root object identifier of the subtree whose values are to be 3482063b2c0SJoel Dahlretrieved. 349a7398723SShteryana ShopovaIf no OID is provided 350a7398723SShteryana Shopova.Nm bsnmpwalk 351a7398723SShteryana Shopovawill walk the mib2 subtree rooted 352a7398723SShteryana Shopovaat .iso(1).org(3).dod(6).internet(1).mgmt(2).mib2(1) . 353a7398723SShteryana Shopova.Pp 354a7398723SShteryana ShopovaAny of the formats used to print a single variable 355a7398723SShteryana Shopovais valid as input OID: 356f0720ed5SUlrich Spörlein.Bl -tag -width \& 357a7398723SShteryana Shopova.It 1.3.6.1.2.1.25.1.1.0 358a7398723SShteryana Shopova.It sysDescr 359a7398723SShteryana Shopova.It ifPhysAddress.1 360a7398723SShteryana Shopova.It ifRcvAddressStatus.2.6.255.255.255.255.255.255 361a7398723SShteryana Shopova.It ifRcvAddressType[2,ff:ff:ff:ff:ff:ff] 362a7398723SShteryana Shopova.It ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff] 363550c00acSChristian Brueffer(requires the 364f0720ed5SUlrich Spörlein.Fl o Ar verbose 365f0720ed5SUlrich Spörleinoption) 366a7398723SShteryana Shopova.El 367a7398723SShteryana Shopova.Pp 368a7398723SShteryana ShopovaSquare brackets are used to denote an entry's indexes. 369a7398723SShteryana ShopovaWhen used in an input OID, the square brackets may have to be 370a7398723SShteryana Shopovaescaped or the OID has to be quoted to protect it from the shell. 371a7398723SShteryana ShopovaNote there is no difference between ifName.1 and "ifName[1]". 372a7398723SShteryana Shopova.It OID Ns = Ns Ar [syntax Ns :] Ns Ar value 373a7398723SShteryana ShopovaThe object identifier with its syntax type and value that is to be set. 374a7398723SShteryana ShopovaAt least one such string OID=[syntax:]value should be provided to 375a7398723SShteryana Shopova.Nm bsnmpset 376a7398723SShteryana Shopovato be able to send a request. 377f0720ed5SUlrich Spörlein.Bl -tag -width \& 378a7398723SShteryana Shopova.It Cm OID 379a7398723SShteryana ShopovaOID may be input as a string, a string followed by a random number of integers 380a7398723SShteryana Shopova(suboids) separated by dots, a sequence of integers separated by dots - that is 381550c00acSChristian Bruefferif the 382f0720ed5SUlrich Spörlein.Ar n 383550c00acSChristian Bruefferoption is used - and in such case a syntax is required for every value, 384a7398723SShteryana Shopovaor a string followed by square brackets (used to denote an entry's indexes) and 385a7398723SShteryana Shopovacorresponding indexes. 386550c00acSChristian BruefferAny of the formats used to print a single variable by 387550c00acSChristian Brueffer.Nm bsnmpset 388550c00acSChristian Bruefferis valid as input OID as well: 389f0720ed5SUlrich Spörlein.Bl -tag -width \& 390a7398723SShteryana Shopova.It 1.3.6.1.2.1.25.1.1.0=TimeTicks:537615486 391f0720ed5SUlrich Spörlein.It sysLocation=OctetString:"@ Home" (with Fl o Ar verbose No option) 392a7398723SShteryana Shopova.It sysLocation.0="@ Home" 393a7398723SShteryana Shopova.It 1.3.6.1.2.1.2.2.1.6.1=OctetString:ffffffffffff 394a7398723SShteryana Shopova.It ifPhysAddress.1="00:02:b3:1d:1c:a3" 395a7398723SShteryana Shopova.It ifRcvAddressStatus.1.6.255.255.255.255.255.255=1 396a7398723SShteryana Shopova.It "ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]=Integer:1" 397550c00acSChristian Brueffer(with the 398f0720ed5SUlrich Spörlein.Fl o Ar verbose 399f0720ed5SUlrich Spörleinoption) 400a7398723SShteryana Shopova.El 401a7398723SShteryana Shopova.It Cm syntax 402550c00acSChristian Bruefferwhere the syntax string is one of: 403a7398723SShteryana ShopovaInteger, OctetString, OID, IpAddress, Counter32, Gauge, TimeTicks, Counter64. 404a7398723SShteryana Shopova.It Cm value 405a7398723SShteryana ShopovaThe value to be set - IP address in form of u.u.u.u - for example 406a7398723SShteryana Shopova1.3.1.6.1.2.0=IpAddress:192.168.0.1, strings require inverted-commas if they 407550c00acSChristian Brueffercontain any special characters or spaces, all other numeric types do not. 408a7398723SShteryana Shopova.El 409f0720ed5SUlrich Spörlein.El 410a7398723SShteryana Shopova.Sh ENVIRONMENT 411a7398723SShteryana Shopova.Nm , 412a7398723SShteryana Shopova.Nm bsnmpwalk 413a7398723SShteryana Shopovaand 414a7398723SShteryana Shopova.Nm bsnmpset 415a7398723SShteryana Shopovause the following environment variables: 416a7398723SShteryana Shopova.Bl -tag -width SNMPAUTH 417a7398723SShteryana Shopova.It Ev SNMPAUTH 418a7398723SShteryana ShopovaSpecifies a default SNMP USM authentication protocol. 419a7398723SShteryana Shopova.It Ev SNMPPRIV 420a7398723SShteryana ShopovaSpecifies a default SNMP USM privacy protocol. 421a7398723SShteryana Shopova.It Ev SNMPUSER 422a7398723SShteryana ShopovaSpecifies a default SNMP USM user name. 423a7398723SShteryana Shopova.It Ev SNMPPASSWD 424a7398723SShteryana ShopovaSpecifies the SNMP USM plain text password to use when calculating localized 425550c00acSChristian Bruefferauthentication and privacy keys. 426550c00acSChristian BruefferIf this variable exists in the environment, 427550c00acSChristian BruefferSNMPv3 is the default version to use for outgoing requests. 428f0720ed5SUlrich Spörlein.El 429a7398723SShteryana Shopova.Sh SEE ALSO 430a7398723SShteryana Shopova.Xr gensnmpdef 1 431a7398723SShteryana Shopova.Sh AUTHORS 43201c2b8acSBaptiste Daroussin.An Shteryana Shopova Aq Mt syrinx@FreeBSD.org 433