~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to man/snmpcmd.1.def

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" Portions of this file are subject to the following copyright.  See
 
2
.\" the Net-SNMP's COPYING file for more details and other copyrights
 
3
.\" that may apply:
 
4
.\"/***********************************************************
 
5
.\"     Copyright 1988, 1989 by Carnegie Mellon University
 
6
.\" 
 
7
.\"                       All Rights Reserved
 
8
.\" 
 
9
.\" Permission to use, copy, modify, and distribute this software and its 
 
10
.\" documentation for any purpose and without fee is hereby granted, 
 
11
.\" provided that the above copyright notice appear in all copies and that
 
12
.\" both that copyright notice and this permission notice appear in 
 
13
.\" supporting documentation, and that the name of CMU not be
 
14
.\" used in advertising or publicity pertaining to distribution of the
 
15
.\" software without specific, written prior permission.  
 
16
.\" 
 
17
.\" CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 
18
.\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 
19
.\" CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
20
.\" ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 
21
.\" WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 
22
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 
23
.\" SOFTWARE.
 
24
.\" ******************************************************************/
 
25
.\" Portions of this file are copyrighted by:
 
26
.\" Copyright Copyright 2003 Sun Microsystems, Inc. All rights reserved.
 
27
.\" Use is subject to license terms specified in the COPYING file
 
28
.\" distributed with the Net-SNMP package.
 
29
.\" ******************************************************************/
 
30
.TH SNMPCMD 1 "09 Jan 2004" VVERSIONINFO "Net-SNMP"
 
31
.UC 4
 
32
.SH NAME
 
33
snmpcmd - commands to communicate with a network entity using SNMP Requests.
 
34
.SH SYNOPSIS
 
35
.B snmpcmd
 
36
[OPTIONS] AGENT [PARAMETERS]
 
37
.SH DESCRIPTION
 
38
This manual page describes the common options for the SNMP commands:
 
39
.BR snmpbulkget ", " snmpbulkwalk ", "  snmpdelta ", " snmpget ", "
 
40
.BR snmpgetnext ", " snmpnetstat ", " snmpset ", " snmpstatus ", "
 
41
.BR snmptable ", " snmptest ", " snmptrap ", 
 
42
.BR " snmpdf", " snmpusm ", " snmpwalk ".  "
 
43
The command line applications use the SNMP protocol to communicate
 
44
with an SNMP capable network entity, an agent.  Individual
 
45
applications typically (but not necessarily) take additional
 
46
parameters that are given after the agent specification.  These
 
47
parameters are documented in the manual pages for each application.
 
48
 
 
49
.SH OPTIONS
 
50
.TP
 
51
.BI -a " authProtocol"
 
52
Set the authentication protocol (MD5|SHA) used for authenticated SNMPv3
 
53
messages. Overrides the defAuthType token in the
 
54
.I  snmp.conf
 
55
file.
 
56
.TP
 
57
.BI -A " authPassword"
 
58
Set the authentication pass phrase used for authenticated SNMPv3
 
59
messages.  Overrides the defAuthPassphrase token in the
 
60
.I snmp.conf
 
61
file. It is insecure to specify pass phrases on the command line,
 
62
see
 
63
.I snmp.conf(5).
 
64
.TP
 
65
.BI -c " community"
 
66
Set the community string for SNMPv1/v2c transactions.
 
67
Overrides the defcommunity token in the
 
68
.I snmp.conf
 
69
file.
 
70
.TP
 
71
.B -d
 
72
Dump (in hexadecimal) the sent and received SNMP packets.
 
73
.TP
 
74
.B -D \fITOKEN[,...]
 
75
Turn on debugging output for the given
 
76
.IR "TOKEN" "(s)."
 
77
Try
 
78
.IR ALL
 
79
for extremely verbose output.
 
80
.TP
 
81
.BI -e " engineID"
 
82
Set the authoritative (security) engineID used for SNMPv3 REQUEST
 
83
messages.  It is typically not necessary to specify this, as it will
 
84
usually be discovered automatically.
 
85
.TP
 
86
.BI -E " engineID"
 
87
Set the context engineID used for SNMPv3 REQUEST messages scopedPdu.
 
88
If not specified, this will default to the authoritative engineID.
 
89
.TP
 
90
.B -h, --help
 
91
Display a brief usage message and then exit.
 
92
.TP
 
93
.B -H
 
94
Display a list of configuration file directives understood by the
 
95
command and then exit.
 
96
.TP
 
97
.BI -I " [brRhu]"
 
98
Specifies input parsing options. See 
 
99
.B INPUT OPTIONS 
 
100
below.
 
101
.TP
 
102
.BI -l " secLevel"
 
103
Set the securityLevel used for SNMPv3 messages
 
104
(noAuthNoPriv|authNoPriv|authPriv).  Appropriate pass phrase(s) must
 
105
provided when using any level higher than noAuthNoPriv.
 
106
Overrides the defSecurityLevel token in the
 
107
.I snmp.conf
 
108
file.
 
109
.TP
 
110
.BI -L " [eEfFoOsS]"
 
111
Specifies output logging options. See 
 
112
.B LOGGING OPTIONS 
 
113
below.
 
114
.TP
 
115
.BI -m " MIBLIST"
 
116
Specifies a colon separated list of MIB modules (not files) to load for
 
117
this application.  This overrides the environment variable MIBS.
 
118
.IP
 
119
The special keyword
 
120
.I ALL
 
121
is used to specify all modules in all directories when searching for MIB
 
122
files.  Every file whose name does not begin with "." will be parsed as
 
123
if it were a MIB file.
 
124
.IP
 
125
If the
 
126
.I MIBLIST
 
127
has a leading '+', then the listed MIB modules are loaded in 
 
128
addition to MIB modules specified in the environment variable MIBS.
 
129
.IP
 
130
If a
 
131
.I mibfile
 
132
token is specified in the
 
133
.I snmp.conf file,
 
134
the 
 
135
.I -m MIB
 
136
option overrides the 
 
137
.I mibfile
 
138
token.
 
139
.TP
 
140
.BI -M " DIRLIST"
 
141
Specifies a colon separated list of directories to search for MIBs.
 
142
This overrides the environment variable MIBDIRS.
 
143
.IP
 
144
If 
 
145
.I DIRLIST
 
146
has a leading '+', then the given directories are added to the list
 
147
of MIB directories.  Without the leading '+', the
 
148
given directory list overrides the list specified with the
 
149
environment variable MIBDIRS. Note that the directories listed at the
 
150
end of the list have precedence over directories at the beginning
 
151
of the list. 
 
152
.IP
 
153
If no value is specified for the environment variable MIBDIRS,
 
154
then the command will still search a default mib directory,
 
155
after it searches the MIB directories specified on the -M
 
156
option.  The default directory is DATADIR/snmp/mibs.
 
157
To avoid having a default mib directory searched, set the
 
158
MIBDIRS environment variable to "".  Even if the default
 
159
MIB directory is searched, the directories specified in the
 
160
-M option have precedence in the search order over the
 
161
default directory.
 
162
.IP
 
163
If the -M option is specified and either a mibfile or mibdirs token
 
164
is also specified in the
 
165
.I snmp.conf
 
166
file, the directories in the
 
167
-M option have precedence in the MIB search order, over the
 
168
directories set with both the mibdirs token and the mibfile token.
 
169
.TP
 
170
.BI -n " contextName"
 
171
Set the destination contextName used for SNMPv3 messages.  The default
 
172
contextName is the empty string "".  Overrides the defContext token
 
173
in the
 
174
.I snmp.conf
 
175
file. 
 
176
.TP
 
177
.BI -O " [abeEfnqQsStTuUvxX]"
 
178
Specifies output printing options. See 
 
179
.B OUTPUT OPTIONS
 
180
below.
 
181
.TP
 
182
.BI -P " [cdeRuwW]"
 
183
Specifies MIB parsing options.  See
 
184
.B MIB PARSING OPTIONS
 
185
below.
 
186
.TP
 
187
.BI -r " retries"
 
188
Specifies the number of retries to be used in the requests. The default
 
189
is 5.
 
190
.TP
 
191
.BI -t " timeout"
 
192
Specifies the timeout in seconds between retries. The default is 1.
 
193
.TP
 
194
.BI -u " secName"
 
195
Set the securityName used for authenticated SNMPv3 messages.
 
196
Overrides the defSecurityName token in the
 
197
.I snmp.conf
 
198
file.
 
199
.TP
 
200
.B -v \fI1\fR | \fI2c\fR | \fI3
 
201
Specifies the protocol version to use: 1 (RFCs 1155-1157), 2c (RFCs 1901-1908),
 
202
or 3 (RFCs 2571-2574).  The default is typically version 3. This option
 
203
overrides the defVersion token in the
 
204
.I snmp.conf
 
205
file.
 
206
.TP
 
207
.B -V, --version
 
208
Display version information for the application and then exit.
 
209
.TP
 
210
.BI -x " privProtocol"
 
211
Set the privacy protocol (DES) used for encrypted SNMPv3 messages.
 
212
.TP
 
213
.BI -X " privPassword"
 
214
Set the privacy pass phrase used for encrypted SNMPv3 messages.
 
215
Overrides the defPrivPassphrase token in the
 
216
.I snmp.conf
 
217
file.
 
218
It is insecure to specify pass phrases on the command line, see
 
219
.I snmp.conf(5).
 
220
.TP
 
221
.BI -Z " boots,time"
 
222
Set the engineBoots and engineTime used for authenticated SNMPv3
 
223
messages.  This will initialize the local notion of the agents
 
224
boots/time with an authenticated value stored in the LCD.
 
225
It is typically not necessary to specify this option, as these values
 
226
will usually be discovered automatically.
 
227
 
 
228
.SH AGENT SPECIFICATION
 
229
.PP
 
230
The string
 
231
.I AGENT
 
232
in the
 
233
.B SYNOPSIS
 
234
above specifies the remote SNMP entity with which to communicate.
 
235
This specification takes the form:
 
236
.IP
 
237
[<transport-specifier>:]<transport-address>
 
238
.PP
 
239
At its simplest, the
 
240
.I AGENT
 
241
specification may consist of a hostname, or an IPv4 address in the
 
242
standard "dotted quad" notation.  In this case, communication will be
 
243
attempted using UDP/IPv4 to port 161 of the given host.  Otherwise,
 
244
the <transport-address> part of the specification is parsed according
 
245
to the following table:
 
246
.RS 4
 
247
.TP 28
 
248
.BR "<transport-specifier>"
 
249
.BR "<transport-address> format"
 
250
.IP "udp" 28
 
251
hostname[:port]
 
252
.I or
 
253
IPv4-address[:port]
 
254
.IP "tcp" 28
 
255
hostname[:port]
 
256
.I or
 
257
IPv4-address[:port]
 
258
.IP "unix" 28
 
259
pathname
 
260
.IP "ipx" 28
 
261
[network]:node[/port]
 
262
.TP 28 
 
263
.IR "" "aal5pvc " or " pvc"
 
264
[interface.][VPI.]VCI
 
265
.IP "udp6 or udpv6 or udpipv6" 28
 
266
hostname[:port]
 
267
.I or
 
268
IPv6-address:port
 
269
.I or
 
270
 '['IPv6-address']'[:port]
 
271
.IP "tcp6 or tcpv6 or tcpipv6"
 
272
hostname[:port]
 
273
.I or
 
274
IPv6-address:port
 
275
.I or
 
276
 '['IPv6-address']'[:port]
 
277
.RE
 
278
.PP
 
279
Note that <transport-specifier> strings are case-insensitive so that,
 
280
for example, "tcp" and "TCP" are equivalent.  Here are some examples,
 
281
along with their interpretation:
 
282
.TP 24
 
283
.IR "hostname:161"
 
284
perform query using UDP/IPv4 datagrams to
 
285
.I hostname
 
286
on port
 
287
.IR 161 .
 
288
The ":161" is redundant here since that is the default SNMP port in
 
289
any case.
 
290
.TP 24
 
291
.IR "udp:hostname"
 
292
identical to the previous specification.  The "udp:" is redundant here
 
293
since UDP/IPv4 is the default transport.
 
294
.TP 24
 
295
.IR "TCP:hostname:1161"
 
296
connect to
 
297
.I hostname
 
298
on port
 
299
.I 1161
 
300
using TCP/IPv4 and perform query over that connection.
 
301
.TP 24
 
302
.IR "ipx::00D0B7AAE308"
 
303
perform query using IPX datagrams to node number 
 
304
.I 00D0B7AAE308
 
305
on the default network, and using the default IPX port of 36879 (900F
 
306
hexadecimal), as suggested in RFC 1906.
 
307
.TP 24
 
308
.IR "ipx:0AE43409:00D0B721C6C0/1161"
 
309
perform query using IPX datagrams to port
 
310
.I 1161
 
311
on node number
 
312
.I 00D0B721C6C0
 
313
on network number
 
314
.IR 0AE43409 .
 
315
.TP 24
 
316
.IR "unix:/tmp/local-agent"
 
317
connect to the Unix domain socket 
 
318
.IR /tmp/local-agent ,
 
319
and perform the query over that connection.
 
320
.TP 24
 
321
.IR "/tmp/local-agent"
 
322
identical to the previous specification, since the Unix domain is the
 
323
default transport iff the first character of the <transport-address>
 
324
is a '/'.
 
325
.TP 24
 
326
.IR "AAL5PVC:100"
 
327
perform the query using AAL5 PDUs sent on the permanent virtual
 
328
circuit with VPI=0 and VCI=100 (decimal) on the first ATM adapter in the
 
329
machine.
 
330
.TP 24
 
331
.IR "PVC:1.10.32"
 
332
perform the query using AAL5 PDUs sent on the permanent virtual
 
333
circuit with VPI=10 (decimal) and VCI=32 (decimal) on the second ATM
 
334
adapter in the machine.  Note that "PVC" is a synonym for "AAL5PVC".
 
335
.TP 24
 
336
.IR "udp6:hostname:10161"
 
337
perform the query using UDP/IPv6 datagrams to port
 
338
.I 10161
 
339
on
 
340
.I hostname
 
341
(which will be looked up as an AAAA record).
 
342
.TP 24
 
343
.IR "UDP6:[fe80::2d0:b7ff:fe21:c6c0]"
 
344
perform the query using UDP/IPv6 datagrams to port 161 at address
 
345
.IR fe80::2d0:b7ff:fe21:c6c0 .
 
346
.TP 24
 
347
.IR "tcpipv6:[::1]:1611"
 
348
connect to port 1611 on the local host
 
349
.IR "" ( ::1 
 
350
in IPv6 parlance) using TCP/IPv6 and perform query over that connection.
 
351
.PP
 
352
Note that not all the transport domains listed above will always be
 
353
available; for instance, hosts with no IPv6 support will not be able
 
354
to use udp6 transport addresses, and attempts to do so will result in
 
355
the error "Unknown host".  Likewise, since AAL5 PVC support is only
 
356
currently available on Linux, it will fail with the same error on
 
357
other platforms.
 
358
 
 
359
.SH "MIB PARSING OPTIONS"
 
360
The Net-SNMP MIB parser mostly adheres to the Structure of Management
 
361
Information (SMI).  As that specification has changed through time, and
 
362
in recognition of the (ahem) diversity in compliance expressed in MIB
 
363
files, additional options provide more flexibility in reading MIB files.
 
364
.TP
 
365
.B "-Pw"
 
366
Show some warning messages in resolving the MIB files.
 
367
Can be also set with the configuration token "mibWarningLevel".
 
368
.TP
 
369
.B "-PW"
 
370
Show additional warning messages.
 
371
Can be also set with the configuration token "mibWarningLevel".
 
372
.TP
 
373
.B "-Pe"
 
374
Show MIB errors.
 
375
Can be also set with the configuration token "showMibErrors".
 
376
An example of an error that would be shown is if an imported
 
377
module is not found during MIB parsing.
 
378
.TP
 
379
.B "-Pc"
 
380
Allow ASN.1 comment to extend to the end of the MIB source line
 
381
(i.e. disallow the use of "--" to terminate comments).
 
382
This overcomes some problems with manually maintained MIB files.
 
383
Can be also set with the configuration token "strictCommentTerm".
 
384
.TP
 
385
.B "-Pd"
 
386
Toggles the default of whether or not to save the DESCRIPTIONs
 
387
of the MIB objects when parsing.  Since the default is to save
 
388
the DESCRIPTIONS, specifying -Pd will cause the DESCRIPTIONs not
 
389
to be saved during MIB parsing.  For example:
 
390
 
 
391
snmptranslate -Td -OS -IR system.sysDescr.0
 
392
 
 
393
will show a description, while
 
394
 
 
395
snmptranslate -Td -OS -IR -Pd system.sysDescr.0
 
396
 
 
397
will not show a description.  Collecting the
 
398
DESCRIPTION information into the parsed hierarchy
 
399
increases the memory used by the size of each DESCRIPTION clause.
 
400
.TP
 
401
.B "-Pu"
 
402
Allow underline characters in symbols.
 
403
Can be also set with the configuration token "mibAllowUnderline".
 
404
.TP
 
405
.B "-PR"
 
406
Replace MIB objects using the last read MIB file.
 
407
The parser will replace MIB objects in its hierarchy whenever
 
408
it sees a sub-identifier and name match.  
 
409
.B WARNING:
 
410
Setting this option may result in an incorrect hierarchy.
 
411
Can be also set with the configuration token "mibReplaceWithLatest".
 
412
 
 
413
.SH "OUTPUT OPTIONS"
 
414
Output display can be controlled by passing various parameters to the
 
415
.B -O
 
416
flag.  The following examples should demonstrate this.
 
417
.PP
 
418
The default output looks as follows:
 
419
.br
 
420
snmpget -c public -v 1 localhost system.sysUpTime.0
 
421
.br
 
422
SNMPv2-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63        
 
423
.TP
 
424
.B -Oq
 
425
Removes the equal sign and type information:
 
426
.br
 
427
system.sysUpTime.0 1:15:09:27.63
 
428
.TP
 
429
.B -OQ
 
430
Removes the type information:
 
431
.br
 
432
system.sysUpTime.0 = 1:15:09:27.63
 
433
.TP
 
434
.B -Of
 
435
Gives you the complete OID:
 
436
.br
 
437
 .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
 
438
.TP
 
439
.B -Os
 
440
Deletes all but the last symbolic part of the OID:
 
441
.br
 
442
sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
 
443
.TP
 
444
.B -OS
 
445
A variation on
 
446
.B -Os
 
447
that adds the name of the MIB that defined the object:
 
448
.br
 
449
SNMPv2-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
 
450
.br
 
451
(from release 5.0, this is now the default output format)
 
452
.TP
 
453
.B -Ou
 
454
Prints the OID in the UCD-style (inherited from the original CMU code),
 
455
That means removing a series of "standard" prefixes, if relevant,
 
456
and breaking down the OID into the displayable pieces.  For example,
 
457
the OID vacmSecruityModel.0.3.119.101.115 is broken down by default
 
458
and the string hidden in the OID is shown.  The result would
 
459
look like: vacmSecurityModel.0."test".  The -Ob option disables this
 
460
feature.
 
461
.br
 
462
system.sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
 
463
.TP
 
464
.B -On
 
465
Prints the OID numerically:
 
466
.br
 
467
 .1.3.6.1.2.1.1.3.0 = Timeticks: (14096763) 1 day, 15:09:27.63
 
468
.TP
 
469
.B -Oe
 
470
Removes the symbolic labels from enumerations:
 
471
.br
 
472
snmpget -c public -v 1 localhost ip.ipForwarding.0
 
473
.br
 
474
ip.ipForwarding.0 = INTEGER: forwarding(1)
 
475
.br
 
476
snmpget -c public -v 1 -Oe localhost ip.ipForwarding.0
 
477
.br
 
478
ip.ipForwarding.0 = INTEGER: 1
 
479
.TP
 
480
.B -Ob
 
481
When OIDs contain a index to a table,
 
482
they are broken into the displayable pieces and shown to you.  For
 
483
example the OID vacmSecurityModel.0.3.119.101.115 is nicely broken
 
484
down by default and the string hidden in the OID is shown to you as
 
485
vacmSecurityModel.0."wes".
 
486
The
 
487
.B -Ob
 
488
option disables this feature and displays it as
 
489
vacmSecurityModel.0.3.119.101.115 again.
 
490
.TP
 
491
.B -OE
 
492
This modifies the index strings to include a \\ to escape the quotes,
 
493
to allow them to be reused in shell commands, such as
 
494
vacmSecurityModel.0.\\"wes\\"
 
495
.TP
 
496
.B -OX
 
497
This modifies the output of index OIDs, to look more "program like".
 
498
Square brackets are placed around each index, and the DISPLAY-HINT
 
499
information and string conversions are used to format each index.
 
500
If you take an entry from the IPV6-MIB::ipv6RouteTable, it is indexed with
 
501
an IPv6 address and two integers, and if you are used to IPv6 addresses
 
502
you will know that decimal OIDs are not the preferred notation. Compare:
 
503
.br
 
504
snmpgetnext -OS host IPV6-MIB:ipv6RouteTable
 
505
.br
 
506
IPV6-MIB::ipv6RouteIfIndex.63.254.1.0.255.0.0.0.0.0.0.0.0.0.0.0.64.1 = INTEGER: 2
 
507
.br
 
508
snmpgetnext -OSX host IPV6-MIB:ipv6RouteTable
 
509
.br
 
510
IPV6-MIB::ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64][1] = INTEGER: 2
 
511
.TP
 
512
.B -Oa
 
513
If a string-valued object definition does not include a Display Hint,
 
514
then the library attempts to determine whether it is an ascii or
 
515
binary string, and displays the value accordingly.
 
516
This flag bypasses this check, and displays all strings as ASCII.
 
517
Note that this does not affect objects that do have a Display Hint.
 
518
.TP
 
519
.B -Ox
 
520
This works similarly to '-Oa', but displays strings as Hex.
 
521
.TP
 
522
.B -OT
 
523
If hexadecimal code is printed, this will also print any printable
 
524
characters after the hexadecimal codes.
 
525
.TP
 
526
.B -Ov
 
527
Output only the variable value, not the OID:
 
528
.br
 
529
snmpget -c public -v 1 -Ov localhost ip.ipForwarding.0
 
530
.br
 
531
INTEGER: forwarding(1)
 
532
.TP
 
533
.B -OU
 
534
Do not print the UNITS suffix at the end of the value.
 
535
.TP
 
536
.B -Ot
 
537
Output timeticks values as raw numbers:
 
538
.br
 
539
system.sysUpTime.0 = 14096763
 
540
.PP
 
541
Note that most of these options can be turned on or off by default by
 
542
tuning the
 
543
.I snmp.conf file.
 
544
See the
 
545
.I snmp.conf(5)
 
546
manual page for details.
 
547
 
 
548
.SH "LOGGING OPTIONS"
 
549
The mechanism and destination to use for logging of warning and error
 
550
messages can be controlled by passing various parameters to the
 
551
.B -L
 
552
flag.
 
553
.TP
 
554
.B -Le
 
555
Log messages to the standard error stream.
 
556
.TP
 
557
.B -Lf FILE
 
558
Log messages to the specified file.
 
559
.TP
 
560
.B -Lo
 
561
Log messages to the standard output stream.
 
562
.TP
 
563
.B -Ls FACILITY
 
564
Log messages via syslog, using the specified facility
 
565
('d' for LOG_DAEMON, 'u' for LOG_USER,
 
566
or '0'-'7' for LOG_LOCAL0 through LOG_LOCAL7).
 
567
.PP
 
568
 
 
569
There are also "upper case" versions of each of these options, which
 
570
allow the corresponding logging mechanism to be restricted to certain
 
571
priorities of message.  Using standard error logging as an example:
 
572
.TP
 
573
.B -LE pri
 
574
will log messages of priority 'pri' and above to standard error.
 
575
.TP
 
576
.B -LE p1-p2
 
577
will log messages with priority between 'p1' and 'p2' (inclusive) to
 
578
standard error.
 
579
.PP
 
580
For
 
581
.B -LF
 
582
and
 
583
.B -LS
 
584
the priority specification comes before the file or facility token.
 
585
The priorities recognised are:
 
586
.IP
 
587
.B 0
 
588
or
 
589
.B !
 
590
for LOG_EMERG,
 
591
.br
 
592
.B 1
 
593
or
 
594
.B a
 
595
for LOG_ALERT,
 
596
.br
 
597
.B 2
 
598
or
 
599
.B c
 
600
for LOG_CRIT,
 
601
.br
 
602
.B 3
 
603
or
 
604
.B e
 
605
for LOG_ERR,
 
606
.br
 
607
.B 4
 
608
or
 
609
.B w
 
610
for LOG_WARNING,
 
611
.br
 
612
.B 5
 
613
or
 
614
.B n
 
615
for LOG_NOTICE,
 
616
.br
 
617
.B 6
 
618
or
 
619
.B i
 
620
for LOG_INFO, and
 
621
.br
 
622
.B 7
 
623
or
 
624
.B d
 
625
for LOG_DEBUG.
 
626
.PP
 
627
Normal output is (or will be!) logged at a priority level of
 
628
.B LOG_NOTICE
 
629
 
 
630
.SH "INPUT OPTIONS"
 
631
The
 
632
.B -I
 
633
flag specifies various options that control how your input to
 
634
the program is parsed.  By default, all input parsing methods are
 
635
used: First the OID is parsed regularly, then
 
636
.B -IR
 
637
is used, then
 
638
.B -Ib
 
639
is used, unless one of the following flags is specified which will
 
640
force it to only use one method.
 
641
.TP
 
642
.B -IR
 
643
The
 
644
.B -IR
 
645
flag specifies random access lookup, so that if the entire OID path is
 
646
not specified, it will search for a node in the MIB tree with the given
 
647
name.  Normally, you would have to specify the vacmSecurityModel OID above
 
648
as .iso.org.dod.internet.snmpV2.snmpModules.snmpVacmMIB.vacmMIBObjects.vacmSecurityToGroupTable.vacmSecurityToGroupEntry.vacmSecurityModel.0."wes",
 
649
but the use of the
 
650
.B -IR
 
651
flag allows you to shorten that to just vacmSecurityModel.0."wes".
 
652
(Though this OID really needs to be quoted - 'vacmSecurityModel.0."wes"' - to
 
653
prevent the shell from swallowing the double quotes).
 
654
.IP
 
655
Additionally, see the
 
656
.B RANDOM ACCESS MIBS
 
657
section below.
 
658
.TP
 
659
.B -Ib
 
660
The
 
661
.B -Ib
 
662
flag indicates that the expression you gave it is actually a regular
 
663
expression that should be used to search for the best match possible in
 
664
the MIB tree.  This would allow you to specify the node
 
665
vacmSecurityModel MIB node as something as generic as vacmsecuritymodel
 
666
(since case insensitive searches are done) or vacm.*model.  Note that
 
667
multiple matches are obviously possible (.* matches everything), and the
 
668
best result is currently calculated as the one that matches the closest
 
669
to the beginning of the node name and the highest in the tree.  A
 
670
current side effect of this option is that you cannot specify indexes
 
671
or multiple nodes, since the '.' is treated as part of the regular
 
672
expression.
 
673
.TP
 
674
.B -Iu
 
675
Use the traditional UCD-style input approach of assuming that OIDs
 
676
are rooted at the 'mib-2' point in the tree (unless they start with
 
677
an explicit '.')   If random access lookup is in effect (which is
 
678
the default for most commands), then this will only affect OIDs
 
679
specified with a leading numberic subidentifier (and no initial '.')
 
680
Thus an input of "snmpcmd ... 1" would refer to 'iso' (from v5.0
 
681
onwards) while "snmpcmd -Iu ... 1" would refer to 'system'.
 
682
.TP
 
683
.B -Ir
 
684
By default, indices into tables and values to be assigned to objects
 
685
are checked against range and type specified in the MIB.  The
 
686
.B -Ir
 
687
flag disables this check.  This flag is mostly useful when you are
 
688
testing an agent.  For normal operation it is useful to get your
 
689
requests checked before they are sent to the remote agent (the
 
690
diagnostic that the library can provide is also much more precise).
 
691
.TP
 
692
.B -Ih
 
693
By default, the library will use DISPLAY-HINT information when assigning values.
 
694
This flag disables this behaviour. The result is that instead of
 
695
.br
 
696
snmpset localhost HOST-RESOURCES-MIB::hrSystemDate.0 = 2002-12-10,2:4:6.8
 
697
.br
 
698
you will have to write
 
699
.br
 
700
snmpset localhost HOST-RESOURCES-MIB::hrSystemData.0 x "07 D2 0C 0A 02 04 06 08"
 
701
.TP
 
702
.B -Is SUFFIX
 
703
Add the specified suffix to each textual OID given on the command line.
 
704
It is useful to specify a common index value when you want to retrieve
 
705
multiple objects from the same row of a table.
 
706
.TP
 
707
.B -IS PREFIX
 
708
Add the specified prefix to each textual OID given on the command line.
 
709
Useful to specify an explicit MIB module name for all objects being retrieved
 
710
(or for incurably lazy typists)
 
711
 
 
712
.SH "RANDOM ACCESS MIBS"
 
713
In previous releases of the UCD-SNMP package (and if using the
 
714
.B -Iu
 
715
option), an object identifier such as system.sysDescr.0 will be
 
716
lookup in a single "well known" place, built into the SNMP library (or
 
717
specified by the P@REFIX environment variable).  The standard place
 
718
is: .iso.org.dod.internet.mgmt.mib-2.  The identifier may alternatively be
 
719
a complete object identifier, this is designated by a leading "dot"
 
720
if using UCD-input style, and is the first thing tried otherwise.
 
721
To simplify the specification of object identifiers the library
 
722
supports random access to the identifiers in the MIBs. This is
 
723
requested by the
 
724
.B -IR
 
725
option to the SNMP applications.  Additionally,
 
726
.B -Os
 
727
prints OIDs in this manner.  Using this, system.sysDescr.0 may
 
728
also be entered as sysDescr.0.  To search only a single MIB for the
 
729
identifier (if it appears in more than one), specify it as
 
730
SNMPv2-MIB::sysDescr.0. (use
 
731
.B -OS
 
732
to print output OIDs in this manner, though this is the default as
 
733
from v5.0). This notation will also ensure
 
734
that the specified MIB is loaded, i.e. it need not be mentioned in the
 
735
.B -m
 
736
option (or MIBS environment variable).
 
737
 
 
738
.SH "ENVIRONMENT VARIABLES"
 
739
.IP P@REFIX
 
740
The standard prefix for object identifiers (if using UCD-style output).
 
741
Defaults to .iso.org.dod.internet.mgmt.mib-2
 
742
.IP MIBS
 
743
The list of MIBs to load. Defaults to
 
744
SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:SNMP-VACM-MIB.
 
745
Overridden by the
 
746
.B -m
 
747
option.
 
748
.IP MIBDIRS
 
749
The list of directories to search for MIBs. Defaults to DATADIR/snmp/mibs.
 
750
Overridden by the
 
751
.B -M
 
752
option.
 
753
 
 
754
.SH FILES
 
755
.IP SYSCONFDIR/snmp/snmpd.conf
 
756
Agent configuration file. See
 
757
.IR snmpd.conf(5) .
 
758
.IP SYSCONFDIR/snmp/snmp.conf
 
759
.IP ~/.snmp/snmp.conf
 
760
Application configuration files. See 
 
761
.IR snmp.conf(5) .
 
762
 
 
763
.SH "SEE ALSO"
 
764
snmpget(1), snmpgetnext(1), snmpset(1),
 
765
snmpbulkget(1), snmpbulkwalk(1), snmpwalk(1),
 
766
snmptable(1), snmpnetstat(1), snmpdelta(1), snmptrap(1), snmpinform(1),
 
767
snmpusm(1), snmpstatus(1), snmptest(1),
 
768
snmp.conf(5).
 
769