Page 1 of 1
Clear state, logs, etc. What is the best way?
Posted: Mon May 13, 2013 2:41 pm
by skol
Summary: We're using our current production setup to test and proof checks, etc before rolling to production. We'd like to clear logs, state, etc before going live. Can I just nuke the logfiles, state dirs etc - or is there a preferred/better way?
Thanks!
Re: Clear state, logs, etc. What is the best way?
Posted: Mon May 13, 2013 3:32 pm
by slansing
Depending on the log file you should be able to remove it and it will re-generate, which logs are you looking to remove?
Re: Clear state, logs, etc. What is the best way?
Posted: Tue May 14, 2013 10:11 am
by skol
I'm looking to clear the:
- event log
- past notifications
- state history
If not, not a big deal.
Re: Clear state, logs, etc. What is the best way?
Posted: Tue May 14, 2013 10:36 am
by abrist
Shut down the nagios service and remove the retention file:
Code: Select all
service nagios stop
rm /usr/local/nagios/var/retention.dat
service nagios start
All checks afterwards will be listed as "pending" and will be scheduled for first checks.
Re: Clear state, logs, etc. What is the best way?
Posted: Tue May 14, 2013 10:41 am
by slansing
You should be able to remove these logs without running into any issues, the logs you will be targeting are:
The archived nagios.log files:
Re: Clear state, logs, etc. What is the best way?
Posted: Tue May 14, 2013 10:42 am
by skol
Cool, thanks!
Re: Clear state, logs, etc. What is the best way?
Posted: Tue May 14, 2013 10:43 am
by slansing
Let us know if you run into any other questions!