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
- Make sure the trap is enabled by following the Enable SNMP Traps documentation.
-
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/
- 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/
- 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.