I am trying to monitor some devices with snmp traps. I have followed the centreon docs and I receive the trap, but I don´t know why it is not working.
I have configured a debug and I config that I receive the trap, but I don´t know why folder /var/spool/centreontrapd/ is always empty. Please if you could help me I would really appreciate that.
Here is my config:
/root@CENTREON2025 ~]# more /etc/snmp/snmptrapd.conf
disableAuthorization yes
traphandle default su -l centreon -c "/usr/share/centreon/bin/centreontrapdforward"
OPTIONS="-On -Lf /var/log/snmptrapd.log -p /var/run/snmptrapd.pid"
----------------
-------------------
/root@CENTREON2025 ~]# more /etc/centreon/centreontrapd.pm
our %centreontrapd_config = (
spool_directory => '/var/spool/centreontrapd/',
# databases credentials
centreon_db => "dbname=/etc/snmp/centreon_traps/1/centreontrapd.sdb",
centstorage_db => "dbname=/etc/snmp/centreon_traps/1/centreontrapd.sdb",
db_type => 'SQLite',
# server type (0: central, 1: poller)
mode => 0
);
1;
--------------------------
--------------------------
proot@CENTREON2025 ~]# more /etc/centreon/conf.pm
#############################################
# File Added by Centreon
#
$centreon_config = {
VarLib => "/var/lib/centreon",
CentreonDir => "/usr/share/centreon/",
CacheDir => "/var/cache/centreon/",
"centreon_db" => "centreon",
"centstorage_db" => "centreon_storage",
"db_host" => "localhost:3306",
"db_user" => "centreon",
"db_passwd" => 'xxxxx'
# "db_passwd" => "centreon"
};
# Central, Remote or Poller ?
$instance_mode = "central";
# Centreon Centcore Command File
$cmdFile = "/var/lib/centreon/centcore.cmd";
# Deprecated format of Config file.
$mysql_user = "centreon";
$mysql_passwd = 'xxxxx';
$mysql_host = "localhost:3306";
$mysql_database_oreon = "centreon";
$mysql_database_ods = "centreon_storage";
1;
------------------
------------------
On the debug I get this:
2025-05-28 16:46:18 - DEBUG - 769 - Trap received from xx.xx.xx.20: .1.3.6.1.6.3.1.1.5.1
2025-05-28 16:46:18 - DEBUG - 769 - 0: hostname
2025-05-28 16:46:18 - DEBUG - 769 - 1: ip address
2025-05-28 16:46:18 - DEBUG - 769 - 2: uptime
2025-05-28 16:46:18 - DEBUG - 769 - 3: trapname / OID
2025-05-28 16:46:18 - DEBUG - 769 - 4: ip address from trap agent
2025-05-28 16:46:18 - DEBUG - 769 - 5: trap community string
2025-05-28 16:46:18 - DEBUG - 769 - 6: enterprise
2025-05-28 16:46:18 - DEBUG - 769 - 7: securityEngineID (not use)
2025-05-28 16:46:18 - DEBUG - 769 - 8: securityName (not use)
2025-05-28 16:46:18 - DEBUG - 769 - 9: contextEngineID (not use)
2025-05-28 16:46:18 - DEBUG - 769 - 10: contextName (not)
2025-05-28 16:46:18 - DEBUG - 769 - 0+: passed variables
2025-05-28 16:46:18 - DEBUG - 769 - Value 0: xx.xx.xx.20
2025-05-28 16:46:18 - DEBUG - 769 - Value 1: xx.xx.xx.20
2025-05-28 16:46:18 - DEBUG - 769 - Value 2: 0:0:00:00.04
2025-05-28 16:46:18 - DEBUG - 769 - Value 3: .1.3.6.1.6.3.1.1.5.1
2025-05-28 16:46:18 - DEBUG - 769 - Value 4: xx.xx.xx.20
2025-05-28 16:46:18 - DEBUG - 769 - Value 5:
2025-05-28 16:46:18 - DEBUG - 769 - Value 6: .1.3.6.1.4.1.8072.3.2.10
2025-05-28 16:46:18 - DEBUG - 769 - Value 7:
2025-05-28 16:46:18 - DEBUG - 769 - Value 8:
2025-05-28 16:46:18 - DEBUG - 769 - Value 9:
2025-05-28 16:46:18 - DEBUG - 769 - Value 10:
2025-05-28 16:46:18 - DEBUG - 769 - Agent dns name: 192.168.107.20
2025-05-28 16:46:18 - DEBUG - 769 - Trap digest: f7a89066c7ea2cebaf3e39affe439887
2025-05-28 16:46:18 - INFO - 769 - SIGCHLD received: 3209
2025-05-28 16:46:18 - INFO - 769 - SIGCHLD received: 3210
2025-05-28 16:46:18 - DEBUG - 769 - Trap found on service 'coldstart_trap' for host 'xx.xx.xx.20'.
2025-05-28 16:46:18 - INFO - 769 - CHLD command launched: 3211
2025-05-28 16:46:18 - DEBUG - 769 - Trap found on service 'app-trap-coldstart' for host '192.168.107.20'.
2025-05-28 16:46:18 - INFO - 769 - CHLD command launched: 3212
2025-05-28 16:46:18 - INFO - 769 - SIGCHLD received: 3211
2025-05-28 16:46:18 - INFO - 769 - SIGCHLD received: 3212
2025-05-28 16:46:18 - DEBUG - 769 - Trap found on service 'coldstart_trap' for host 'xx.xx.xx.20'.
2025-05-28 16:46:18 - INFO - 769 - CHLD command launched: 3213
2025-05-28 16:46:18 - DEBUG - 769 - Sleeping for 2 seconds
2025-05-28 16:46:18 - INFO - 769 - SIGCHLD received: 3213
But there are nothing on folder centreontrapd
nroot@CENTREON2025 ~]# ls -lathr /var/spool/centreontrapd/
total 0
drwxr-xr-x. 8 root root 91 Nov 22 2024 ..
drwxrwxrwt. 2 centreon centreon 6 May 28 16:46 .
aroot@CENTREON2025 ~]#