Files
notes/areas/OPNsense/plugins/net-snmp.md
2025-03-18 14:23:17 +01:00

2.0 KiB

SNMP Konfiguration mit bsnmpd

Die hier beschriebene Anleitung konfiguriert SNMP in der Version 2c. Installiere nicht das SNMP Plugin! (i.e.: os-net-smp) Es wird nicht mit bsnmp funktionieren.

Schritte auf der OPNsense

  1. Oeffne eine OPNsense Konsole (zum Beispiel: ssh ueber vpn) und melde dich als root-user an. (Befehl: su)
  2. Aktiviere den bsnmpd-Dienst durch Erstellung der Datei /etc/rc.conf.d/bsnmpd mit dem folgenden Inhalt: bsnmpd_enable="YES"
  3. Auskommentiere die folgenden Zeilen in /etc/snmpd.config, um benoetigte SNMP Module zu aktivieren:
read := "your_snmp_community"
begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"

Trage fuer die Variable read den genutzten Community Namen ein. 4. Starte den bsnmpd-Dienst mit dem folgenden Befehl: /etc/rc.d/bsnmpd start 5. Setze eine Firewall Regel auf, welche es erlaubt von einem Quell Geraet die OPNsense ueber den SNMP Port (161) zu erreichen. 6. Teste die Verbindung durch eine SNMP Abfrage an der OPNsense.

Dont use

*** This port installs snmpd, header files and libraries but does not
     start snmpd by default.
     If you want to auto-start snmpd and snmptrapd, add the following to
     /etc/rc.conf:

	snmpd_enable="YES"
	snmpd_flags="-a"
	snmpd_conffile="/usr/local/share/snmp/snmpd.conf /etc/snmpd.conf"
	snmptrapd_enable="YES"
	snmptrapd_flags="-a -p /var/run/snmptrapd.pid"

**** You may also specify the following make variables:

	NET_SNMP_SYS_CONTACT="zi@FreeBSD.org"
	NET_SNMP_SYS_LOCATION="USA"
	DEFAULT_SNMP_VERSION=3
	NET_SNMP_MIB_MODULES="host smux mibII/mta_sendmail ucd-snmp/diskio"
	NET_SNMP_LOGFILE=/var/log/snmpd.log
	NET_SNMP_PERSISTENTDIR=/var/net-snmp

     to define default values (or to override the defaults).  To avoid being
     prompted during the configuration process, you should (minimally) define
     the first two variables. (NET_SNMP_SYS_*)

     You may also define the following to avoid all interactive configuration:

	BATCH="yes"