Page 1 of 1

How to purge milions of SNMP Received Traps?

Posted: Thu Oct 08, 2020 10:54 am
by TethiS
HI,

On the SNMP Trap Interface/Received Traps tab I have about 9 milions ( :| ) traps already logged.
Didn't notice this was an issue until I had to define a new trap and then look for it after sending a test; the search takes minutes before anything is shown and during this time the snmptraphandler got stuck, stopping the processing of any other passive commands (i had to kill the stuck instance to resume processing the backlog).

I noticed the Toggle Received Trap Logging is enabled by default and thought of disabling it.
My next question would be, how do I purge all the 9 milion of lines already received? I get it is not doable from the interface (as it would kill the browser/apache ) but directly from some table.

Where could i find this information? :roll:

Thank you!

Edit: is that "xi_cmp_trapdata_log" table ?

Re: How to purge milions of SNMP Received Traps?

Posted: Fri Oct 09, 2020 9:23 am
by cdienger
xi_cmp_trapdata_log is the location. You can truncate it with:

Code: Select all

echo "truncate xi_cmp_trapdata_log;" | mysql -uroot -pnagiosxi -Dnagiosxi