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
This commit is contained in:
JoshWeepie
2019-01-17 15:48:04 -06:00
committed by Tony Murray
parent ba71f69240
commit 5d41c851db

View File

@@ -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.