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!
Clear state, logs, etc. What is the best way?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Clear state, logs, etc. What is the best way?
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?
I'm looking to clear the:
- event log
- past notifications
- state history
If not, not a big deal.
- event log
- past notifications
- state history
If not, not a big deal.
Re: Clear state, logs, etc. What is the best way?
Shut down the nagios service and remove the retention file:
All checks afterwards will be listed as "pending" and will be scheduled for first checks.
Code: Select all
service nagios stop
rm /usr/local/nagios/var/retention.dat
service nagios startFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Clear state, logs, etc. What is the best way?
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:
The archived nagios.log files:
Code: Select all
/usr/local/nagios/var/archives/Re: Clear state, logs, etc. What is the best way?
Cool, thanks!
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Clear state, logs, etc. What is the best way?
Let us know if you run into any other questions!