Page 1 of 1

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

Posted: Sat Jan 24, 2015 11:00 am
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

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

Posted: Mon Jan 26, 2015 10:01 am
by scottwilkerson
Admin -> Performance Settings -> Database Tab

Allows you to set truncations to keep data for how long you want of specific types.

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

Posted: Wed Jan 28, 2015 4:59 pm
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

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

Posted: Wed Jan 28, 2015 5:40 pm
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).

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

Posted: Fri Jan 30, 2015 2:44 pm
by zaji_nms
Dear scottwilkerson / Expert

Thanks for your reply, you can close the case.

Regards

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

Posted: Fri Jan 30, 2015 2:46 pm
by cmerchant
We'll go ahead and close the thread. Thanks.