How to purge milions of SNMP Received Traps?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
TethiS
Posts: 32
Joined: Tue Aug 04, 2020 9:37 am
Location: Bucharest

How to purge milions of SNMP Received Traps?

Post 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 ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: How to purge milions of SNMP Received Traps?

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked