summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-04-17 10:47:58 +0000
committerglebius <glebius@FreeBSD.org>2005-04-17 10:47:58 +0000
commit07ad0b76bc3c463f046619730731fb80590119aa (patch)
tree30692d45cbf7d0fb3817d031076c0d7385e67395 /etc
parent0fd846eb5e25bb6a49303919122074b94c5a88e9 (diff)
downloadFreeBSD-src-07ad0b76bc3c463f046619730731fb80590119aa.zip
FreeBSD-src-07ad0b76bc3c463f046619730731fb80590119aa.tar.gz
Add startup script and default configuration file for bsnmpd.
Reviewed by: harti
Diffstat (limited to 'etc')
-rw-r--r--etc/Makefile4
-rw-r--r--etc/defaults/rc.conf6
-rwxr-xr-xetc/rc.d/Makefile2
-rw-r--r--etc/rc.d/bsnmpd18
-rw-r--r--etc/snmpd.config67
5 files changed, 94 insertions, 3 deletions
diff --git a/etc/Makefile b/etc/Makefile
index b2a77dd..43ac510 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -13,8 +13,8 @@ BIN1= amd.map apmd.conf auth.conf \
mac.conf motd netconfig network.subr networks newsyslog.conf \
pf.conf pf.os phones profile protocols \
rc rc.bsdextended rc.firewall rc.firewall6 rc.sendmail rc.shutdown \
- rc.subr remote rpc services \
- shells sysctl.conf syslog.conf usbd.conf \
+ rc.subr remote rpc services shells \
+ snmpd.config sysctl.conf syslog.conf usbd.conf \
etc.${MACHINE_ARCH}/ttys \
${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
${.CURDIR}/../usr.bin/mail/misc/mail.rc \
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 6bc7efe..790b473 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -247,6 +247,12 @@ nis_ypxfrd_flags="" # Flags to rpc.ypxfrd (if enabled).
nis_yppasswdd_enable="NO" # Run rpc.yppasswdd at boot time (or NO).
nis_yppasswdd_flags="" # Flags to rpc.yppasswdd (if enabled).
+### SNMP daemon ###
+# Be sure to understand the security implications of running SNMP v1/v2
+# in your network.
+bsnmpd_enable="NO" # Run the SNMP daemon (or NO).
+bsnmpd_flags="" # Flags for bsnmpd.
+
### Network routing options: ###
defaultrouter="NO" # Set to default gateway (or NO).
static_routes="" # Set to static route list (or leave empty).
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index 7a4b500..5fa7a00 100755
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -4,7 +4,7 @@
FILES= DAEMON LOGIN NETWORKING SERVERS \
abi accounting addswap adjkerntz amd \
apm apmd archdep atm1 atm2 atm3 \
- bgfsck bootparams \
+ bgfsck bootparams bsnmpd \
ccd cleanvar cleartmp cron \
devd devfs dhclient \
dmesg dumpon \
diff --git a/etc/rc.d/bsnmpd b/etc/rc.d/bsnmpd
new file mode 100644
index 0000000..e266c3b
--- /dev/null
+++ b/etc/rc.d/bsnmpd
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: bsnmpd
+# REQUIRE: NETWORKING syslogd
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="bsnmpd"
+rcvar=`set_rcvar`
+command="/usr/sbin/${name}"
+pidfile="/var/run/snmpd.pid"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/etc/snmpd.config b/etc/snmpd.config
new file mode 100644
index 0000000..2260373
--- /dev/null
+++ b/etc/snmpd.config
@@ -0,0 +1,67 @@
+# $FreeBSD$
+#
+# Example configuration file for bsnmpd(1).
+#
+
+#
+# Set some common variables
+#
+host := foo.bar.com
+location := "Room 200"
+contact := "sysmeister@bar.com"
+system := 1 # FreeBSD
+traphost := noc.bar.com
+trapport := 162
+
+# Change this!
+read := "public"
+write := "geheim"
+trap := "mytrap"
+
+#
+# Configuration
+#
+%snmpd
+begemotSnmpdDebugDumpPdus = 2
+begemotSnmpdDebugSyslogPri = 7
+
+begemotSnmpdCommunityString.0.1 = $(read)
+begemotSnmpdCommunityString.0.2 = $(write)
+begemotSnmpdCommunityDisable = 1
+
+# open standard SNMP ports
+begemotSnmpdPortStatus.[$(host)].161 = 1
+begemotSnmpdPortStatus.127.0.0.1.161 = 1
+
+# open a unix domain socket
+begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
+begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
+
+# send traps to the traphost
+begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
+begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
+begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
+
+sysContact = $(contact)
+sysLocation = $(location)
+sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
+
+snmpEnableAuthenTraps = 2
+
+#
+# Load MIB-2 module
+#
+begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"
+
+#
+# Netgraph module
+#
+#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
+#
+#%netgraph
+#begemotNgControlNodeName = "snmpd"
+
+#
+# pf(4) module
+#
+#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"
OpenPOWER on IntegriCloud