old data what can safely delete and how to delete by period

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

old data what can safely delete and how to delete by period

Post by zaji_nms »

Dear Expert/abrist

On one of my Post you replied:

How to delete old ALERT History?
How to delete old Notification History?
from abrist
This can be performed by truncating the tables. WARNING - This action will permanently remove the history from the db!!!
echo "use nagios; truncate nagios_notifications;" | mysql -pnagiosxi
What exactly do you mean by "ALERT history"?
Alert History (Host/Service UP/Down Status) by default generating upon link adding regardless of Notification On/Off.

You have simply mentioned : echo "use nagios; truncate nagios_notifications;"

Its okay but I am pretty sure there is some more parameter to delete the history on period (from date/time to date/time) as we don't want to delete all. Also related to only one Host/Service.

Upon delete HOST/SERVICE, all the Notification/Alert getting erased from Nagios?

Is there any document(s) what we can delete (old data) and how can be delete without any risk , just that its old no more in use.

I think on the main menu Cleaning option should be there in Web with Admin privilege, so he can delete old data.

Regards
Zajil NMS
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: old data what can safely delete and how to delete by per

Post by scottwilkerson »

Admin -> Performance Settings -> Database Tab

Allows you to set truncations to keep data for how long you want of specific types.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: old data what can safely delete and how to delete by per

Post by zaji_nms »

Dear scottwilkerson

On the menu/option you suggested, there only one line description which difficult for the new Nagios user/admin to understand. On the top right of that page no option for documentation which is there for some options.

So me still looking some answer from you (there is two below questions), appreciate answer one-by-one.

You have simply mentioned : echo "use nagios; truncate nagios_notifications;"
Its okay but I am pretty sure there is some more parameter to delete the history on period (from date/time to date/time) as we don't want to delete all. Can you please suggest some sample two/three command for different field, how to delete manually as our wish?

If HOST get deleted, all the Event, Notification, Alert related to that HOST get deleted or still remain in DATABASE?

Regards
Zajil NMS
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: old data what can safely delete and how to delete by per

Post by scottwilkerson »

zaji_nms wrote:On the menu/option you suggested, there only one line description which difficult for the new Nagios user/admin to understand. On the top right of that page no option for documentation which is there for some options.
On the top right of page is a ? icon which has a link that will take you to this document
http://assets.nagios.com/downloads/nagi ... zation.pdf

In this document you will see further description, but for example, the item labeled "Max Notifications Age" is the number of days you want to keep items in the notification table.

abrist mentioned running the command to truncate the whole table, but I would stick to using the settings in Admin -> Performance Settings -> Database Tab because you will only be eliminating data older than you specify.
zaji_nms wrote: If HOST get deleted, all the Event, Notification, Alert related to that HOST get deleted or still remain in DATABASE?
Actually the data will still be in the DB even if you delete a host until it reaches the times specified on "Admin -> Performance Settings -> Database Tab", furthermore, the data for deleted hosts will remail in the full text log files on the system forever (or until you manually delete them).
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: old data what can safely delete and how to delete by per

Post by zaji_nms »

Dear scottwilkerson / Expert

Thanks for your reply, you can close the case.

Regards
Zajil NMS
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: old data what can safely delete and how to delete by per

Post by cmerchant »

We'll go ahead and close the thread. Thanks.
Locked