snmpd.config revision 310876
1145184Sglebius# $FreeBSD: stable/10/etc/snmpd.config 310876 2016-12-30 23:59:43Z 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#
119310876Sngie# Bridge module
120310876Sngie#  This requires the mibII module.
121310876Sngie#
122310876Sngie#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so"
123310876Sngie
124310876Sngie#
125310876Sngie# Host resources module
126310876Sngie#  This requires the mibII module.
127310876Sngie#
128310876Sngie#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
129310876Sngie
130310876Sngie#
131310876Sngie# MIB-2 module
132310876Sngie#
133310876SngiebegemotSnmpdModulePath."mibII"	= "/usr/lib/snmp_mibII.so"
134310876Sngie
135310876Sngie#
136310876Sngie# Netgraph module
137310876Sngie#
138310876Sngie#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
139310876Sngie
140310876Sngie#
141310876Sngie# pf(4) module
142310876Sngie#
143310876Sngie#begemotSnmpdModulePath."pf"	= "/usr/lib/snmp_pf.so"
144310876Sngie
145310876Sngie#
146310876Sngie# SNMPv3 Notification Targets
147310876Sngie#
148310876Sngie# begemotSnmpdModulePath."target"	= "/usr/lib/snmp_target.so"
149310876Sngie
150310876Sngie#
151216300Ssyrinx# SNMPv3 User-based security module - must be loaded for SNMPv3 USM
152216300Ssyrinx#
153216300Ssyrinx#begemotSnmpdModulePath."usm"	= "/usr/lib/snmp_usm.so"
154216300Ssyrinx
155216300Ssyrinx#
156310876Sngie# SNMPv3 View-based Access Control module
157310876Sngie#
158310876Sngie#begemotSnmpdModulePath."vacm"	= "/usr/lib/snmp_vacm.so"
159310876Sngie
160310876Sngie#
161310876Sngie# Wireless module
162310876Sngie#  This requires the mibII module.
163310876Sngie#
164310876Sngie#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so"
165310876Sngie
166310876Sngie#
167216300Ssyrinx# SNMPv3 USM User definition.
168216300Ssyrinx#
169216300Ssyrinx
170216300Ssyrinx#%usm
171216300Ssyrinx
172216300Ssyrinx#
173216300Ssyrinx# The following block creates a user with name "bsnmp" and sets privacy
174216300Ssyrinx# and encryption options to SHA256 message digests and AES encryption
175216300Ssyrinx# for this user.
176310568Sngie#
177216300Ssyrinx# usmUserStatus.$(engine).$(user1) = 5
178216300Ssyrinx# usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol)
179216300Ssyrinx# usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd)
180216300Ssyrinx# usmUserPrivProtocol.$(engine).$(user1) = $(AesCfb128Protocol)
181216300Ssyrinx# usmUserPrivKeyChange.$(engine).$(user1) = $(user1passwd)
182216300Ssyrinx# usmUserStatus.$(engine).$(user1) = 1
183216300Ssyrinx#
184216300Ssyrinx
185216300Ssyrinx#
186216300Ssyrinx# The following block creates a user with name "public" with no authentication
187216301Ssyrinx# or encryption options.
188216300Ssyrinx#
189216300Ssyrinx# usmUserStatus.$(engine).$(read) = 5
190216300Ssyrinx# usmUserAuthProtocol.$(engine).$(read) = $(NoAuthProtocol)
191216300Ssyrinx# usmUserPrivProtocol.$(engine).$(read) = $(NoPrivProtocol)
192216300Ssyrinx# usmUserStatus.$(engine).$(read) = 1
193216300Ssyrinx#
194216300Ssyrinx
195216300Ssyrinx#
196216300Ssyrinx# Definition of view-based access control entries.
197216300Ssyrinx#
198216300Ssyrinx#%vacm
199216300Ssyrinx
200216300Ssyrinx# Definition of a SNMPv1 group
201216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelSNMPv1).$(read) = 4
202216595Ssyrinx# vacmGroupName.$(securityModelSNMPv1).$(read) = $(read)
203216300Ssyrinx
204216300Ssyrinx# Definition of SNMPv2 group
205216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelSNMPv2c).$(write) = 4
206216595Ssyrinx# vacmGroupName.$(securityModelSNMPv2c).$(write) = $(write)
207216300Ssyrinx
208216300Ssyrinx# Definition of SNMPv3 group with users "bsnmp" and "public"
209216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelUSM).$(user1) = 4
210216595Ssyrinx# vacmGroupName.$(securityModelUSM).$(user1) = $(write)
211216595Ssyrinx# vacmSecurityToGroupStatus.$(securityModelUSM).$(read) = 4
212216595Ssyrinx# vacmGroupName.$(securityModelUSM).$(read) = $(write)
213216300Ssyrinx
214310568Sngie#
215216300Ssyrinx# The OID of the .iso.org.dod.internet subtree
216216300Ssyrinx#
217216300Ssyrinx# internetoid := 1.3.6.1
218216300Ssyrinx# internetoidlen := 4
219216300Ssyrinx
220216300Ssyrinx#
221216300Ssyrinx# Definitions of two views
222216300Ssyrinx#
223216300Ssyrinx# vacmViewTreeFamilyStatus."internet".$(internetoidlen).$(internetoid) = 4
224216300Ssyrinx# vacmViewTreeFamilyStatus."restricted".$(internetoidlen).$(internetoid) = 4
225216300Ssyrinx
226216300Ssyrinx#
227216300Ssyrinx# Access control
228216300Ssyrinx#
229216300Ssyrinx
230216300Ssyrinx#
231216300Ssyrinx# Read-only access for SNMPv1 users
232216300Ssyrinx#
233216595Ssyrinx# vacmAccessStatus.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = 4
234216595Ssyrinx# vacmAccessReadViewName.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = "internet"
235216300Ssyrinx
236216300Ssyrinx#
237310568Sngie# Read-write access for SNMPv2 users
238216300Ssyrinx#
239216595Ssyrinx# vacmAccessStatus.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = 4
240216595Ssyrinx# vacmAccessReadViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet"
241216595Ssyrinx# vacmAccessWriteViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet"
242216300Ssyrinx
243216300Ssyrinx#
244216300Ssyrinx# Read-write-notify access for SNMPv3 USM users with noAuthNoPriv
245216300Ssyrinx#
246216300Ssyrinx# vacmAccessStatus.$(write)."".3.$(noAuthNoPriv) = 4
247216595Ssyrinx# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet"
248216595Ssyrinx# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet"
249216595Ssyrinx# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet"
250216300Ssyrinx
251216300Ssyrinx#
252216300Ssyrinx#Read-write-notify access to restricted for SNMPv3 USM users with authPriv
253216300Ssyrinx#
254310876Sngie# vacmAccessStatus.$(write)."".$(securityModelUSM).$(authPriv) = 4
255310876Sngie# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted"
256310876Sngie# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted"
257310876Sngie# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted"
258216300Ssyrinx
259216595Ssyrinx#%target
260216595Ssyrinx# Send notifications to target tag "test"
261216595Ssyrinx# tag		:= "test"
262216595Ssyrinx# snmpNotifyRowStatus.$(tag) = 4
263216595Ssyrinx# snmpNotifyTag.$(tag) = $(tag)
264216595Ssyrinx
265216595Ssyrinx# tagremote		:= "testremote"
266216595Ssyrinx# snmpNotifyRowStatus.$(tagremote) = 4
267216595Ssyrinx# snmpNotifyTag.$(tagremote) = $(tagremote)
268216595Ssyrinx
269216595Ssyrinx#
270216595Ssyrinx# Specify the target parameters for the notifications - send with the credentials
271216595Ssyrinx# of user "bsnmp"
272216595Ssyrinx#
273216595Ssyrinx# snmpTargetParamsRowStatus.$(tag) = 5
274216595Ssyrinx# snmpTargetParamsMPModel.$(tag) = $(MPmodelSNMPv3)
275216595Ssyrinx# snmpTargetParamsSecurityModel.$(tag) = $(securityModelUSM)
276216595Ssyrinx# snmpTargetParamsSecurityName.$(tag) = $(user1)
277216595Ssyrinx# snmpTargetParamsSecurityLevel.$(tag) = $(authPriv)
278216595Ssyrinx# snmpTargetParamsRowStatus.$(tag) = 1
279216595Ssyrinx
280216595Ssyrinx#
281216595Ssyrinx# Define the notifications' target address - port 162 on localhost
282216595Ssyrinx#
283216595Ssyrinx# snmpTargetAddrRowStatus.$(tag) = 5
284216595Ssyrinx# snmpTargetAddrTAddress.$(tag) = 0x7f:0x0:0x0:0x1:0x0:0xa2
285216595Ssyrinx# snmpTargetAddrTagList.$(tag) = "test notification"
286216595Ssyrinx# snmpTargetAddrParams.$(tag) = $(tag)
287216595Ssyrinx# snmpTargetAddrRowStatus.$(tag) = 1
288216595Ssyrinx
289216595Ssyrinx#
290216595Ssyrinx# Define the notifications' target address - port 162 on 10.0.0.1
291216595Ssyrinx#
292216595Ssyrinx# snmpTargetAddrRowStatus.$(tagremote) = 5
293216595Ssyrinx# snmpTargetAddrTAddress.$(tagremote) = 0x0a:0x00:0x00:0x1:0x0:0xa2
294216595Ssyrinx# snmpTargetAddrTagList.$(tagremote) = $(tagremote)
295216595Ssyrinx# snmpTargetAddrParams.$(tagremote) = $(tag)
296216595Ssyrinx# snmpTargetAddrRowStatus.$(tagremote) = 1
297216595Ssyrinx
298216595Ssyrinx# Force a polling rate for the 64-bit interface counters in case
299216595Ssyrinx# the automatic computation is wrong (which may be the case if an interface
300216595Ssyrinx# announces the wrong bit rate via its MIB).
301216595Ssyrinx#%mibII
302216595Ssyrinx#begemotIfForcePoll = 2000
303216595Ssyrinx
304145184Sglebius#%netgraph
305145184Sglebius#begemotNgControlNodeName = "snmpd"
306