Troubleshooting

Generating SNMP trap is not working

  • 9 October 2023
  • 0 replies
  • 339 views

Userlevel 4
Badge +6

This article explains how to troubleshoot the SNMP trap generation through the user interface.
 

Symptom

 

You are trying to generate a trap as follows:

But nothing happens. No trap logged in /var/log/messages or /var/log/snmptrapd.log

 

Solution

 

  1. Make sure the trap is enabled by following the Enable SNMP Traps documentation.
  2. Make sure centreon-gorgone (user+groupe) is the owner on a poller:
    ls -l /etc/snmp/centreon_traps/centreontrapd.sdb

    But it could be in a subdirectory. For example for a central or a remote:
    ls -lR /etc/snmp/centreon_traps/

  3. If centreon-gorgone is not the owner, you need to set it on the poller as below:
    chown centreon-gorgone. /etc/snmp/centreon_traps/centreontrapd.sdb

    For a central or remote server, apache (or www-data for Debian) should be the owner, not centreon-gorgone:
    chown -R apache. /etc/snmp/centreon_traps/

  4. Try to generate the trap again as follows. It should be working now!
     


Still stuck?

 

  • If the service centreontrapd still doesn’t start, enter the following command:
    systemctl status centreontrapd
  • The partition is probably full:
    df -h
    df -i
  • Enter this command to clean old traps:
    rm -rf /var/spool/centreontrapd/

 

This time, the trap generation should work. The logs should provide information about the trap.


0 replies

Be the first to reply!

Reply