Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. First you want to install snmptrapd. I also recommend going ahead and enabling snmptrapd to start automatically in case of server reboots

    Code Block
    languagebash
    titleInstall snmptrapd
    apt-get install snmptrapd
    systemctl enable snmptrapd


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

    Code Block
    languagebash
    titleEdit snmptrapd service
    systemctl edit snmptrapd


  3. 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)

    Code Block
    languagetext
    titleoverride.conf text
    [Service]
    ExecStart=
    ExecStart=/usr/sbin/snmptrapd -f -n -Oq -Ls2 -m ALL -M /usr/local/nmis9/mibs/traptraps

  4. Edit the /etc/default/snmptrapd file, replacing default TRAPDOTS with the below:

    Code Block
    languagebash
    titleedit snmptrapd
    vi /etc/default/snmptrapd 


    Code Block
    languagetext
    title /etc/default/snmptrapd
    TRAPDOPTS='-n -LS2d -p /var/run/snmptrapd.pid -m ALL -M /usr/local/nmis9/mibs/traps'
    TRAPDRUN=yes


  5. Edit the /etc/snmp/snmptrapd.conf file,


    Code Block
    languagebash
    titleedit snmptrapd.conf
    vi /etc/snmp/snmptrapd.conf


    Code Block
    languagetext
    title /etc/snmp/snmptrapd.conf
    disableAuthorization yes
    #If you have installed nmis9 in a different directory make sure to change below to match.
    traphandle default /usr/local/nmis9/bin/traplog.pl


  6. Now we need to reload the daemon and restart the service.


    Code Block
    languagebash
    titlereload daemons
    systemctl daemon-reload
    systemctl restart snmptrapd
    # Always a good idea to check status
    systemctl status snmptrapd


...