snmpd.config revision 313224
1145184Sglebius# $FreeBSD: stable/10/etc/snmpd.config 313224 2017-02-04 16:43:35Z ngie $
2145184Sglebius#
3145184Sglebius# Example configuration file for bsnmpd(1).
4145184Sglebius#
5145184Sglebius
6145184Sglebius#
7145184Sglebius# Set some common variables
8145184Sglebius#
9145184Sglebiuslocation := "Room 200"
10155768Scericontact := "sysmeister@example.com"
11145184Sglebiussystem := 1	# FreeBSD
12155458Sglebiustraphost := localhost
13145184Sglebiustrapport := 162
14145184Sglebius
15216300Ssyrinx#
16216300Ssyrinx# Set the SNMP engine ID.
17216300Ssyrinx#
18216300Ssyrinx# The snmpEngineID object required from the SNMPv3 Framework. If not explicitly set via
19216300Ssyrinx# this configuration file, an ID is assigned based on the value of the
20216300Ssyrinx# kern.hostid variable
21216300Ssyrinx# engine := 0x80:0x10:0x08:0x10:0x80:0x25
22216300Ssyrinx# snmpEngineID = $(engine)
23216300Ssyrinx
24145184Sglebius# Change this!
25145184Sglebiusread := "public"
26165685Smaxim# Uncomment begemotSnmpdCommunityString.0.2 below that sets the community
27165685Smaxim# string to enable write access.
28145184Sglebiuswrite := "geheim"
29145184Sglebiustrap := "mytrap"
30145184Sglebius
31216595Ssyrinx#
32216300Ssyrinx# Declarations for SNMP-USER-BASED-SM-MIB authentication and privacy options
33216595Ssyrinx#
34216595Ssyrinx
35216300SsyrinxNoAuthProtocol		:= 1.3.6.1.6.3.10.1.1.1
36216300SsyrinxHMACMD5AuthProtocol	:= 1.3.6.1.6.3.10.1.1.2
37216300SsyrinxHMACSHAAuthProtocol	:= 1.3.6.1.6.3.10.1.1.3
38216300SsyrinxNoPrivProtocol		:= 1.3.6.1.6.3.10.1.2.1
39216300SsyrinxDESPrivProtocol		:= 1.3.6.1.6.3.10.1.2.2
40216300SsyrinxAesCfb128Protocol	:= 1.3.6.1.6.3.10.1.2.4
41216300Ssyrinx
42145184Sglebius#
43216595Ssyrinx# Enumerations from SNMP-FRAMEWORK-MIB
44216595Ssyrinx#
45216595Ssyrinx
46216595Ssyrinx# Security models
47216595SsyrinxsecurityModelAny	:= 0
48216595SsyrinxsecurityModelSNMPv1	:= 1
49216595SsyrinxsecurityModelSNMPv2c	:= 2
50216595SsyrinxsecurityModelUSM	:= 3
51216595Ssyrinx
52216595Ssyrinx# Message Processing models
53216595SsyrinxMPmodelSNMPv1		:= 0
54216595SsyrinxMPmodelSNMPv2c		:= 1
55216595SsyrinxMPmodelSNMPv3		:= 3
56216595Ssyrinx
57216595Ssyrinx# Security levels
58216595SsyrinxnoAuthNoPriv := 1
59216595SsyrinxauthNoPriv := 2
60216595SsyrinxauthPriv := 3
61216595Ssyrinx
62216595Ssyrinx
63216300Ssyrinx# SNMPv3 USM User definition
64216300Ssyrinx#
65216300Ssyrinx# The localized hex password for a user may be obtained by setting SNMPUSER, SNMPPASSWD,
66216300Ssyrinx# SNMPAUTH and SNMPPRIV environment variables to the desired parameters and invoking
67216300Ssyrinx# 'bsnmpget -v 3 -D -K -o verbose' against the running bsnmpd(1). For other
68216300Ssyrinx# usages refer to the bsnmpget(1) manual page. The following lines define a user "bsnmp"
69216595Ssyrinx# with a private password "bsnmptest", localized for the above engine ID.
70216300Ssyrinx#
71216595Ssyrinx#user1 := "bsnmp"
72216595Ssyrinx#user1passwd := 0x22:0x98:0x1a:0x6e:0x39:0x93:0x16:0x5e:0x6a:0x21:0x1b:0xd8:0xa9:0x81:0x31:0x05:0x16:0x33:0x38:0x60
73216300Ssyrinx
74216300Ssyrinx#
75145184Sglebius# Configuration
76145184Sglebius#
77145184Sglebius%snmpd
78145184SglebiusbegemotSnmpdDebugDumpPdus	= 2
79145184SglebiusbegemotSnmpdDebugSyslogPri	= 7
80145184Sglebius
81154186Sharti#
82154186Sharti# Set the read and write communities.
83154186Sharti#
84154186Sharti# The default value of the community strings is NULL (note, that this is
85154186Sharti# different from the empty string). This disables both read and write access.
86154186Sharti# To enable read access only the read community string must be set. Setting
87154186Sharti# the write community string enables both read and write access with that
88154186Sharti# string.
89154186Sharti#
90154186Sharti# Be sure to understand the security implications of SNMPv2 - the community
91154186Sharti# strings are readable on the wire!
92154186Sharti#
93145184SglebiusbegemotSnmpdCommunityString.0.1	= $(read)
94154186Sharti# begemotSnmpdCommunityString.0.2	= $(write)
95145184SglebiusbegemotSnmpdCommunityDisable	= 1
96145184Sglebius
97145184Sglebius# open standard SNMP ports
98163823ShartibegemotSnmpdPortStatus.0.0.0.0.161 = 1
99145184Sglebius
100145184Sglebius# open a unix domain socket
101145184SglebiusbegemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
102145184SglebiusbegemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
103145184Sglebius
104145184Sglebius# send traps to the traphost
105145184SglebiusbegemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
106145184SglebiusbegemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
107145184SglebiusbegemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
108145184Sglebius
109145184SglebiussysContact	= $(contact)
110145184SglebiussysLocation	= $(location)
111145184SglebiussysObjectId 	= 1.3.6.1.4.1.12325.1.1.2.1.$(system)
112145184Sglebius
113145184SglebiussnmpEnableAuthenTraps = 2
114145184Sglebius
115310876Sngie# Uncomment `begemotSnmpdModulePath.".." = ".."' entries below to enable
116310876Sngie# modules
117310876Sngie
118145184Sglebius#
119313224Sngie# Control configuration for the modules in the module specific sections, e.g.
120313224Sngie# the "usm" module (begemotSnmpdModulePath."usm") can be controlled in the
121313224Sngie# %usm specific section. You must uncomment the section specific header in
122313224Sngie# order to use the enclosed variables, e.g. `usmUserStatus.$(engine).$(user1)`
123313224Sngie# can only be used if %usm is uncommented.
124313224Sngie#
125313224Sngie
126313224Sngie#
127310876Sngie# Bridge module
128310876Sngie#  This requires the mibII module.
129310876Sngie#
130310876Sngie#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so"
131310876Sngie
132310876Sngie#
133310876Sngie# Host resources module
134310876Sngie#  This requires the mibII module.
135310876Sngie#
136310876Sngie#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
137310876Sngie
138310876Sngie#
139310876Sngie# MIB-2 module
140310876Sngie#
141310876SngiebegemotSnmpdModulePath."mibII"	= "/usr/lib/snmp_mibII.so"
142310876Sngie
143310876Sngie#
144310876Sngie# Netgraph module
145310876Sngie#
146310876Sngie#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
147310876Sngie
148310876Sngie#
149310876Sngie# pf(4) module
150310876Sngie#
151310876Sngie#begemotSnmpdModulePath."pf"	= "/usr/lib/snmp_pf.so"
152310876Sngie
153310876Sngie#
154310876Sngie# SNMPv3 Notification Targets
155310876Sngie#
156310876Sngie# begemotSnmpdModulePath."target"	= "/usr/lib/snmp_target.so"
157310876Sngie
158310876Sngie#
159216300Ssyrinx# SNMPv3 User-based security module - must be loaded for SNMPv3 USM
160216300Ssyrinx#
161216300Ssyrinx#begemotSnmpdModulePath."usm"	= "/usr/lib/snmp_usm.so"
162216300Ssyrinx
163216300Ssyrinx#
164310876Sngie# SNMPv3 View-based Access Control module
165310876Sngie#
166310876Sngie#begemotSnmpdModulePath."vacm"	= "/usr/lib/snmp_vacm.so"
167310876Sngie
168310876Sngie#
169310876Sngie# Wireless module
170310876Sngie#  This requires the mibII module.
171310876Sngie#
172310876Sngie#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so"
173310876Sngie
174310876Sngie#
175216300Ssyrinx# SNMPv3 USM User definition.
176216300Ssyrinx#
177216300Ssyrinx
178216300Ssyrinx#%usm
179216300Ssyrinx
180216300Ssyrinx#
181216300Ssyrinx# The following block creates a user with name "bsnmp" and sets privacy
182216300Ssyrinx# and encryption options to SHA256 message digests and AES encryption
183216300Ssyrinx# for this user.
184310568Sngie#
185216300Ssyrinx# usmUserStatus.$(engine).$(user1) = 5
186216300Ssyrinx# usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol)
187216300Ssyrinx# usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd)
188216300Ssyrinx# usmUserPrivProtocol.$(engine).$(user1) = $(AesCfb128Protocol)
189216300Ssyrinx# usmUserPrivKeyChange.$(engine).$(user1) = $(user1passwd)
190216300Ssyrinx# usmUserStatus.$(engine).$(user1) = 1
191216300Ssyrinx#
192216300Ssyrinx
193216300Ssyrinx#
194216300Ssyrinx# The following block creates a user with name "public" with no authentication
195216301Ssyrinx# or encryption options.
196216300Ssyrinx#
197216300Ssyrinx# usmUserStatus.$(engine).$(read) = 5
198216300Ssyrinx# usmUserAuthProtocol.$(engine).$(read) = $(NoAuthProtocol)
199216300Ssyrinx# usmUserPrivProtocol.$(engine).$(read) = $(NoPrivProtocol)
200216300Ssyrinx# usmUserStatus.$(engine).$(read) = 1
201216300Ssyrinx#
202216300Ssyrinx
203216300Ssyrinx#
204216300Ssyrinx# Definition of view-based access control entries.
205216300Ssyrinx#
206216300Ssyrinx#%vacm
207216300Ssyrinx
208216300Ssyrinx# Definition of a SNMPv1 group
209216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelSNMPv1).$(read) = 4
210216595Ssyrinx# vacmGroupName.$(securityModelSNMPv1).$(read) = $(read)
211216300Ssyrinx
212216300Ssyrinx# Definition of SNMPv2 group
213216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelSNMPv2c).$(write) = 4
214216595Ssyrinx# vacmGroupName.$(securityModelSNMPv2c).$(write) = $(write)
215216300Ssyrinx
216216300Ssyrinx# Definition of SNMPv3 group with users "bsnmp" and "public"
217216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelUSM).$(user1) = 4
218216595Ssyrinx# vacmGroupName.$(securityModelUSM).$(user1) = $(write)
219216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelUSM).$(read) = 4
220216595Ssyrinx# vacmGroupName.$(securityModelUSM).$(read) = $(write)
221216300Ssyrinx
222310568Sngie#
223216300Ssyrinx# The OID of the .iso.org.dod.internet subtree
224216300Ssyrinx#
225216300Ssyrinx# internetoid := 1.3.6.1
226216300Ssyrinx# internetoidlen := 4
227216300Ssyrinx
228216300Ssyrinx#
229216300Ssyrinx# Definitions of two views
230216300Ssyrinx#
231216300Ssyrinx# vacmViewTreeFamilyStatus."internet".$(internetoidlen).$(internetoid) = 4
232216300Ssyrinx# vacmViewTreeFamilyStatus."restricted".$(internetoidlen).$(internetoid) = 4
233216300Ssyrinx
234216300Ssyrinx#
235216300Ssyrinx# Access control
236216300Ssyrinx#
237216300Ssyrinx
238216300Ssyrinx#
239216300Ssyrinx# Read-only access for SNMPv1 users
240216300Ssyrinx#
241216595Ssyrinx# vacmAccessStatus.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = 4
242216595Ssyrinx# vacmAccessReadViewName.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = "internet"
243216300Ssyrinx
244216300Ssyrinx#
245310568Sngie# Read-write access for SNMPv2 users
246216300Ssyrinx#
247216595Ssyrinx# vacmAccessStatus.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = 4
248216595Ssyrinx# vacmAccessReadViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet"
249216595Ssyrinx# vacmAccessWriteViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet"
250216300Ssyrinx
251216300Ssyrinx#
252216300Ssyrinx# Read-write-notify access for SNMPv3 USM users with noAuthNoPriv
253216300Ssyrinx#
254216300Ssyrinx# vacmAccessStatus.$(write)."".3.$(noAuthNoPriv) = 4
255216595Ssyrinx# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet"
256216595Ssyrinx# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet"
257216595Ssyrinx# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet"
258216300Ssyrinx
259216300Ssyrinx#
260216300Ssyrinx#Read-write-notify access to restricted for SNMPv3 USM users with authPriv
261216300Ssyrinx#
262310876Sngie# vacmAccessStatus.$(write)."".$(securityModelUSM).$(authPriv) = 4
263310876Sngie# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted"
264310876Sngie# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted"
265310876Sngie# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted"
266216300Ssyrinx
267216595Ssyrinx#%target
268216595Ssyrinx# Send notifications to target tag "test"
269216595Ssyrinx# tag		:= "test"
270216595Ssyrinx# snmpNotifyRowStatus.$(tag) = 4
271216595Ssyrinx# snmpNotifyTag.$(tag) = $(tag)
272216595Ssyrinx
273216595Ssyrinx# tagremote		:= "testremote"
274216595Ssyrinx# snmpNotifyRowStatus.$(tagremote) = 4
275216595Ssyrinx# snmpNotifyTag.$(tagremote) = $(tagremote)
276216595Ssyrinx
277216595Ssyrinx#
278216595Ssyrinx# Specify the target parameters for the notifications - send with the credentials
279216595Ssyrinx# of user "bsnmp"
280216595Ssyrinx#
281216595Ssyrinx# snmpTargetParamsRowStatus.$(tag) = 5
282216595Ssyrinx# snmpTargetParamsMPModel.$(tag) = $(MPmodelSNMPv3)
283216595Ssyrinx# snmpTargetParamsSecurityModel.$(tag) = $(securityModelUSM)
284216595Ssyrinx# snmpTargetParamsSecurityName.$(tag) = $(user1)
285216595Ssyrinx# snmpTargetParamsSecurityLevel.$(tag) = $(authPriv)
286216595Ssyrinx# snmpTargetParamsRowStatus.$(tag) = 1
287216595Ssyrinx
288216595Ssyrinx#
289216595Ssyrinx# Define the notifications' target address - port 162 on localhost
290216595Ssyrinx#
291216595Ssyrinx# snmpTargetAddrRowStatus.$(tag) = 5
292216595Ssyrinx# snmpTargetAddrTAddress.$(tag) = 0x7f:0x0:0x0:0x1:0x0:0xa2
293216595Ssyrinx# snmpTargetAddrTagList.$(tag) = "test notification"
294216595Ssyrinx# snmpTargetAddrParams.$(tag) = $(tag)
295216595Ssyrinx# snmpTargetAddrRowStatus.$(tag) = 1
296216595Ssyrinx
297216595Ssyrinx#
298216595Ssyrinx# Define the notifications' target address - port 162 on 10.0.0.1
299216595Ssyrinx#
300216595Ssyrinx# snmpTargetAddrRowStatus.$(tagremote) = 5
301216595Ssyrinx# snmpTargetAddrTAddress.$(tagremote) = 0x0a:0x00:0x00:0x1:0x0:0xa2
302216595Ssyrinx# snmpTargetAddrTagList.$(tagremote) = $(tagremote)
303216595Ssyrinx# snmpTargetAddrParams.$(tagremote) = $(tag)
304216595Ssyrinx# snmpTargetAddrRowStatus.$(tagremote) = 1
305216595Ssyrinx
306216595Ssyrinx# Force a polling rate for the 64-bit interface counters in case
307216595Ssyrinx# the automatic computation is wrong (which may be the case if an interface
308216595Ssyrinx# announces the wrong bit rate via its MIB).
309216595Ssyrinx#%mibII
310216595Ssyrinx#begemotIfForcePoll = 2000
311216595Ssyrinx
312145184Sglebius#%netgraph
313145184Sglebius#begemotNgControlNodeName = "snmpd"
314