When wanting to implement NMIS9 as trap and syslog receiver on Ubuntu 20.04 or greater.
First you want to install snmptrapd. I also recommend going ahead and enabling snmptrapd to start automatically in case of server reboots
With NET-SNMP Version 5.8 and systemd you will need to override snmptrapd.service. This means that when starting snmptrapd the options you put in the override file will be what starts and not what snmptrapd defaults with.
In the edit window that appears you will want to paste the below text. Editor is nano, I recommend using the default file name so you just need to save and exit (ctl+o, ctl+w)
Edit the /etc/default/snmptrapd file, replacing default TRAPDOTS with the below:
- Edit the /etc/snmp/snmptrapd.conf file,
Now we need to reload the daemon and restart the service.
First you want to make sure rsyslog is installed, I also recommend going ahead and making sure its enabled to start automatically in case of server reboots
Copy the rsyslog.conf file from nmis9/conf-default/rsyslog and replace the current rsyslog file.
Now we will edit rsyslog.
Reload and restart Daemon
Time to test! To verify operation you can send a test trap either locally or from another Linux server, this example sends an Opmantek event trap.
Add New SNMP MIBS for Trap Processing
If you are receiving SNMP traps from devices which are just numbers, then you will need to add the MIBS so that the SNMP trap daemon can decode them them for you. First you need to identify the required MIB files and any dependant MIB files and then copy those files to the directory /usr/local/nmis9/mibs/traps and restart the SNMP trap daemon.
You can test the decoding using the snmptranslate command, which was described in a previous section.
Documentation to understand snmptrap and its options