summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/snmpd.conf.5
blob: aca2b7665697bf1e479436171e7402998d3601f2 (plain)
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
.\" $OpenBSD: snmpd.conf.5,v 1.2 2007/12/15 05:26:05 reyk Exp $
.\"
.\" Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
.\"
.\" 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: December 15 2007 $
.Dt SNMPD.CONF 5
.Os
.Sh NAME
.Nm snmpd.conf
.Nd configuration file for the SNMP daemon
.Sh DESCRIPTION
.Nm
is the configuration file for the
.Xr snmpd 8
daemon.
.Sh SECTIONS
The
.Nm
file is divided into 3 main sections.
.Bl -tag -width xxxx
.It Sy Macros
User-defined variables may be defined and used later, simplifying the
configuration file.
.It Sy Global Configuration
Global runtime settings for
.Xr snmpd 8 .
.It Sy OID Configuration
Custom configuration of SNMP object identifiers and values.
.El
.Pp
Comments can be put anywhere in the file using a hash mark
.Pq Sq # ,
and extend to the end of the current line.
.Pp
Additional configuration files can be included with the
.Ic include
keyword, for example:
.Bd -literal -offset indent
include "/etc/snmpd.conf.local"
.Ed
.Sh MACROS
Macros can be defined that will later be expanded in context.
Macro names must start with a letter, and may contain letters, digits
and underscores.
Macro names may not be reserved words (for example,
.Ic community ,
.Ic system ,
or
.Ic oid ) .
Macros are not expanded inside quotes.
.Pp
For example:
.Bd -literal -offset indent
ext_addr="192.168.0.1"
listen on $ext_addr
.Ed
.Sh GLOBAL CONFIGURATION
The following options can be set globally:
.Pp
.Bl -tag -width Ds -compact
.It Ic listen on Ar address
Specify the local address
.Nm
should listen on for incoming SNMP messages.
.Pp
.It Ic read-only community Ar string
Specify the name of the read-only community.
The default value is
.Ar public .
.Pp
.It Ic read-write community Ar string
Specify the name of the read-write community.
The default value is
.Ar private .
.\".Pp
.\".It Ic trap community Ar string
.\"Specify the name of the trap community.
.\"The default value is
.\".Ar public .
.Pp
.It Ic system contact Ar string
Specify the name or description of the system contact, typically a
name or an e-mail address.
The default value is
.Ar root@hostname
using the hostname of the local machine.
.Pp
.It Ic system description Ar string
Specify a description of the local system.
The default value is the operating system identification as printed by the
.Xr uname 1
command using the
.Ar -a
flag:
.Bd -literal -offset indent
OpenBSD myhost.example.com 4.2 GENERIC#595 i386
.Ed
.Pp
.It Ic system location Ar string
Specify the string describing the location of the local system,
typically a physical location.
The default value is an empty string.
.Pp
.It Ic system name Ar string
Specify the name of the local system, typically a fully-qualified
domain name.
The default value is the hostname of the local system.
.Pp
.It Ic system oid Ar oid-string
Specify the authoritative identification of the local system.
The default value is
.Ar 1.3.6.1.4.1.30155.23.1
.Pq iso.org.dod.internet.private.enterprises.openbsd.23.1
indentifying a common OpenBSD system.
.Pp
.It Ic system services Ar number
Specify a magic value which indicates the set of services that the local
system may provide.
Refer to the
.Ar sysServices
description in the SNMP MIB for details.
.\"XXX describe the complicated services alg here
.Pp
.El
.Sh OID CONFIGURATION
It is possible to specify user-defined OIDs in the configuration file:
.Pp
.Bl -tag -width Ds -compact
.It Xo
.Ic oid Ar oid-string
.Ic name Ar name
.Op Ic read-only \*(Ba\ read-write
.Op Ar type
.Ar value
.Xc
Return the specified value to the client for this OID, the
.Ic read-write
option may allow the client to override it,
and the type is is either
.Ic string
or
.Ic integer .
.Sh EXAMPLES
The following example will tell
.Nm
to listen on localhost, override the default system OID, set the
magic services value and some custom OID values:
.Pp
.Bd -literal -offset indent
listen on 127.0.0.1

system oid 1.3.6.1.4.1.30155.23.2
system services 74

oid 1.3.6.1.4.1.30155.42.1 name myName read-only string "humppa"
oid 1.3.6.1.4.1.30155.42.2 name myStatus read-only integer 1
.El
.Sh FILES
.Bl -tag -width "/etc/snmpd.conf" -compact
.It Pa /etc/snmpd.conf
Default location of the configuration file.
.El
.Sh SEE ALSO
.Xr snmpd 8
.Sh HISTORY
The
.Nm
file format first appeared in
.Ox 4.3 .
.Sh AUTHORS
The
.Xr snmpd 8
program was written by
.An Reyk Floeter Aq reyk@vantronix.net .