1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
.\" $OpenBSD: snmpctl.8,v 1.20 2013/10/07 11:40:09 reyk Exp $
.\"
.\" Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: October 7 2013 $
.Dt SNMPCTL 8
.Os
.Sh NAME
.Nm snmpctl
.Nd control the SNMP daemon
.Sh SYNOPSIS
.Nm
.Op Fl n
.Op Fl s Ar socket
.Ar command
.Op Ar arg ...
.Sh DESCRIPTION
The
.Nm
program controls the
.Xr snmpd 8
daemon.
Commands may be abbreviated to the minimum unambiguous prefix; for example,
.Cm s m
for
.Cm show mib .
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl n
Show numeric OID values instead of their symbolic names.
.It Fl s Ar socket
Use
.Ar socket
instead of the default
.Pa /var/run/snmpd.sock
to communicate with
.Xr snmpd 8 .
.El
.Pp
The following commands are available:
.Bl -tag -width Ds
.It Cm monitor
Monitor internal messages of the
.Xr snmpd 8
subsystems and engines.
.It Cm show mib
Dump the tree of compiled-in MIB objects.
.It Xo
.Cm snmp Ar request Ar host
.Op Ar options
.Xc
Request information from an SNMP agent that is running on the specified
.Ar host .
The
.Ar request
can be either
.Ic get ,
.Ic walk
or
.Ic bulkwalk
to retrieve a single SNMP value or a subtree.
The following
.Ar options
are supported:
.Pp
.Bl -tag -width bitstringXXXXXXXX -compact
.It Cm community Ar value
Set the SNMPv2 community; the default is
.Sq public .
.It Xo
.Cm oid
.Pq Ic all Ns | Ns Ar value
.Xc
Set the start OID; the default is
.Sq system .
This option can be specified multiple times.
.It Cm version Ar value
Set the SNMP version, either
.Ic 1
or
.Ic 2c .
The default is
.Ic 2c .
.El
.It Xo
.Cm trap send Ar oid-string
.Op Cm oid Ar oid-string Ar type value ...
.Xc
Send an SNMP trap via
.Xr snmpd 8
to the registered trap receivers.
The command takes one
.Ar oid-string
argument as the trap OID and optional varbind arguments with the specified
.Ar oid-string ,
.Ar type ,
and
.Ar value .
The following types are supported:
.Pp
.Bl -tag -width bitstringXXXXXXXX -compact
.It Cm ip Ar value
An IPv4 address.
.It Cm counter Ar value
A 32-bit counter.
.It Cm gauge Ar value
A 32-bit gauge.
.It Cm unsigned Ar value
A 32-bit unsigned integer.
.It Cm ticks Ar value
A 32-bit timeticks integer value.
.It Cm opaque Ar value
A 32-bit opaque.
.It Cm nsap Ar value
A 32-bit NSAP address.
.It Cm counter64 Ar value
A 64-bit counter.
.It Cm uint Ar value
A 32-bit unsigned integer.
.It Cm int Ar value
A 32-bit integer.
.It Cm bitstring Ar string
A bit string.
.It Cm string Ar string
An octet string.
.It Cm null
This type takes no argument.
.It Cm oid Ar oid-string
An string describing an Object ID, for example
.Ar 1.3.6.1.4.1.30155 .
.El
.It Cm walk Ar host
Alias for
.Ic snmp walk Ar host ,
see above.
.El
.Sh FILES
.Bl -tag -width "/var/run/snmpd.sockXX" -compact
.It /var/run/snmpd.sock
default
.Ux Ns -domain
socket used for communication with
.Xr snmpd 8
.El
.Sh SEE ALSO
.Xr snmpd 8
.Sh HISTORY
The
.Nm
program first appeared in
.Ox 4.3 .
.Sh AUTHORS
The
.Nm
program was written by
.An Reyk Floeter Aq Mt reyk@openbsd.org .
|