Skip to main content

Hello,

In order to test passive checks on my Centreon i have configured SNMP Trap for changing on the running configuration.

Tthe switch i try to monitor is Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE10a.

I use the passive check OID : .1.3.6.1.4.1.9.9.43.2.0.2 that was already built in Centreon.

But when i’m trying to test this OID my service, it still be on “pending”.

My configuration receives the check because i can see on my logs this output :

I have followed https://docs.centreon.com/fr/docs/20.04/monitoring/passive-monitoring/enable-snmp-traps and https://docs.centreon.com/fr/docs/monitoring/passive-monitoring/debug-snmp-traps-management to debug my configuration.

Do you have any suggestions to resolve this problem ?

Thanks a lot.

Hi, 


Do you have anything in /var/log/centreon/centreontrapd.log file? Is centreontrapd running (service centreontrapd status)? 

 

Note that you can actively poll for configuration change with this mode (just in case).


Hello,

I have the following error on my /var/log/centreon/centreontrapd.log :

2022-02-15 03:54:52 - ERROR - 8723 - MySQL error: MySQL server has gone away (caller: centreon::trapd::lib:/usr/share/perl5/vendor_perl/centreon/trapd/lib.pm:501)
Query: SELECT traps_oid, traps_id, traps_mode FROM traps

2022-02-15 03:54:52 - ERROR - 8723 - Cant load cache trap oids.
2022-02-15 03:54:52 - ERROR - 8723 - Dont skip trap. Need to solve the error

Thanks


Are you on a Central server or a Poller?


Make sure you have exported trap definition database here: 
 

 

Then select relevant server, tick boxes and click on Generate: 

 


Hello, i am on a Centreon-central and i have indeed generated the SNMP Trap configuration, i have checked my services and they are all up and running, it might be an OID issue that’s not recognized.

I have checked on https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?module=CISCO-PRODUCTS-MIB and https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst2960/software/release/12-2_55_se/configuration/guide/scg_2960/swmibs.html but i can’t find the right oid to use...

 


Hello,

I have the following error on my /var/log/centreon/centreontrapd.log :

2022-02-15 03:54:52 - ERROR - 8723 - MySQL error: MySQL server has gone away (caller: centreon::trapd::lib:/usr/share/perl5/vendor_perl/centreon/trapd/lib.pm:501)
Query: SELECT traps_oid, traps_id, traps_mode FROM traps

2022-02-15 03:54:52 - ERROR - 8723 - Cant load cache trap oids.
2022-02-15 03:54:52 - ERROR - 8723 - Dont skip trap. Need to solve the error

Thanks

Hi,

No the problem is above, to confirm that the trap is received, you can list the /var/spool/centreontrapd directory content. You will probably see files containing SNMP trap to process. 

Can you check in the config file that the mode is correctly set: in /etc/centreon/centreontrapd.pm you should have a mode => 0 directive like below: 

 

#############################################
# File Added by Centreon
#
our %centreontrapd_config = (
# databases credentials
centreon_db => "dbname=/etc/snmp/centreon_traps/centreontrapd.sdb",
centstorage_db => "dbname=/etc/snmp/centreon_traps/centreontrapd.sdb",
db_type => 'SQLite',
# server type (0: central, 1: poller)
mode => 0
);

1;

 

 

 

 


Hello,

I have the following configuration :

[root@centreon-central ~]# ls /var/spool/centreontrapd
[root@centreon-central ~]# cat /etc/centreon/centreontrapd.pm
#############################################
# File Added by Centreon
#
our %centreontrapd_config = (
# databases credentials
centreon_db => "dbname=/etc/snmp/centreon_traps/centreontrapd.sdb",
centstorage_db => "dbname=/etc/snmp/centreon_traps/centreontrapd.sdb",
db_type => 'SQLite',
# server type (0: central, 1: poller)
mode => 0
);

1;

But still have the following error :


2022-02-17 11:09:50 - ERROR - 10209 - MySQL error: MySQL server has gone away (caller: centreon::trapd::lib:/usr/share/perl5/vendor_perl/centreon/trapd/lib.pm:501)
Query: SELECT traps_oid, traps_id, traps_mode FROM traps

2022-02-17 11:09:50 - ERROR - 10209 - Cant load cache trap oids.
2022-02-17 11:09:50 - ERROR - 10209 - Dont skip trap. Need to solve the error.

When i export the trap definition database i have no errors :

 


Hello

 

Can you edit the file /etc/centreon/centreontrapd.pm and define it like this?

#############################################
# File Added by Centreon
#
our %centreontrapd_config = (
# 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;

I added the sub directory “/1/” in the SQLite database path.

 

You will need to restart centreontrapd process.


Hello

 

Can you edit the file /etc/centreon/centreontrapd.pm and define it like this?

#############################################
# File Added by Centreon
#
our %centreontrapd_config = (
# 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;

I added the sub directory “/1/” in the SQLite database path.

 

You will need to restart centreontrapd process.

 

Hello, thank you for your answer, i did the modification but nothing seems changing i still have my passive checks on “pending” status.


Hello

Ok the service state is Pending but do you still have this kind of error message?

2022-02-15 03:54:52 - ERROR - 8723 - MySQL error: MySQL server has gone away (caller: centreon::trapd::lib:/usr/share/perl5/vendor_perl/centreon/trapd/lib.pm:501)
Query: SELECT traps_oid, traps_id, traps_mode FROM traps

2022-02-15 03:54:52 - ERROR - 8723 - Cant load cache trap oids.
2022-02-15 03:54:52 - ERROR - 8723 - Dont skip trap. Need to solve the error

Did you enabled “Submit result” on the OID definition?


Hello, there is no error message but i have now this kind of messages :

2022-02-28 10:45:44 - DEBUG - 904 - Sleeping for 2 seconds 
2022-02-28 10:45:46 - DEBUG - 904 - Sleeping for 2 seconds
2022-02-28 10:45:48 - DEBUG - 904 - Sleeping for 2 seconds
2022-02-28 10:45:50 - DEBUG - 904 - Sleeping for 2 seconds

Submit result is activated.

-------

I tried with a linux to manually activate a trap and it works as expected :

but when i’m trying to trap the result for a cisco switch :

i indeed recieve the trap on my centreon-central :

but still in a pending status on my monitoring interface :

thanks.


Can you share with us the centreontrapd debug for the trap received from your Cisco switch?


Sure :

I understand that SNMP-TRAPS has been triggered :

 


I have modify my passive check and it works now !! Thank you for your help :

I’ll try to find other use cases with other OID now, thank you so much !


Thanks for your feedback


Hello Seaev,

 

Can I ask you how did you configure your passive check ont his host ?

 

Thanks.


Reply