Deleting old entries from alarms table
-
Hi!
I have not been able to find any retention settings for the alarms table, in the same way you can set retention for events (Server config). Am I missing something?Otherwise, is it safe to manually delete old entries from alarms table? Are there some related tables that should be cleaned as well? Could deletion be done while the netxms server is running?
Postgres database, if that matters.Table has grown quite large over time, and I would like to set up some archiving procedure.
netxms=# select count(*) from alarms;
count
--------
579673
(1 row)Best regards,
Kjell -
Hi!
Yes, it's actually a bug. There should be retention time for alarms. I'll add it to bug list.
Currently, you can safely delete terminated alarms while NetXMS server is running. You can do it like this:DELETE FROM alarms WHERE alarm_state=2 AND last_change_time<(timestamp here)
We use UNIX timestamp (seconds since 01.01.1970 00:00:00 UTC).
Best regards,
Victor
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login