Versions Compared

Key

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

...

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

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


  2. Copy the rsyslog.conf file from nmis9/conf-default/rsyslog and replace the current rsyslog file.


    Code Block
    languagebash
    titlersyslog
    #make a backup of the orginal
    cp /etc/rsyslog.conf /etc/rsyslog.conf.bak
    cp /usr/local/nmis9/conf-default/rsyslogd/rsyslog.conf /etc/rsyslog.conf


  3. Now we will edit rsyslog to add in our snmptrap processing.

    Code Block
    languagebash
    titlersyslog.conf edit
    vi /etc/rsyslog.conf


    Code Block
    languagetext
    titlersyslog text add
    # Go to the end of the file and add:
    
    local7.*                                                /usr/local/nmis9/logs/device.log
    
    


  4. Reload and restart Daemon

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


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

    Code Block
    languagebash
    titletest trap
    sudo snmptrap -v 2c  -c public 127.0.0.1 80000 1.3.6.1.4.1.4818 1.3.6.1.4.1.4818.1 s Event


...