From 5d41c851db991656f6059382d8d8d17b569ccb6b Mon Sep 17 00:00:00 2001 From: JoshWeepie <43789756+JoshWeepie@users.noreply.github.com> Date: Thu, 17 Jan 2019 15:48:04 -0600 Subject: [PATCH] docs:Update SNMP-Trap-Handler.md (#9654) * Update SNMP-Trap-Handler.md Added additional info to assist with the snmpd configuration on Ubuntu. * Update SNMP-Trap-Handler.md * Update SNMP-Trap-Handler.md * Update SNMP-Trap-Handler.md * Update SNMP-Trap-Handler.md * Update SNMP-Trap-Handler.md * Update SNMP-Trap-Handler.md --- doc/Extensions/SNMP-Trap-Handler.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/Extensions/SNMP-Trap-Handler.md b/doc/Extensions/SNMP-Trap-Handler.md index d9f73dc7b8..1c846cc047 100644 --- a/doc/Extensions/SNMP-Trap-Handler.md +++ b/doc/Extensions/SNMP-Trap-Handler.md @@ -11,7 +11,19 @@ Traps are handled via snmptrapd. Install snmptrapd via your package manager. -Modify startup options to include `-M /opt/librenms/mibs -m ALL` +To enable snmptrapd to properly parse traps, we will need to add MIBs. + +Make the folder `/etc/systemd/system/snmptrapd.service.d/` and edit the file `/etc/systemd/system/snmptrapd.service.d/mibs.conf` and add the following content. You may want to tweak to add vendor directories for devices you care about (in addition to or instead of cisco). + +```ini +[Service] +Environment=MIBDIRS=+/opt/librenms/mibs:/opt/librenms/mibs/cisco +Environment=MIBS=+ALL +``` + +For non-systemd systems, you can edit TRAPDOPTS in the init script in /etc/init.d/snmptrapd. + +`TRAPDOPTS="-Lsd -M /opt/librenms/mibs -m ALL -f -p $TRAPD_PID"` In `/etc/snmp/snmptrapd.conf`, add something like the following: @@ -21,6 +33,14 @@ traphandle default /opt/librenms/snmptrap.php Along with any necessary configuration to receive the traps from your devices (community, etc.) +Reload service files, enable, and start the snmptrapd service: + +``` +sudo systemctl daemon-reload +sudo systemctl enable snmptrapd +sudo systemctl restart snmptrapd +``` + ### Event logging You can configure generic event logging for snmp traps. This will log an event of the type trap for received traps.