After play a little with nagios tuning some variables etc. I want go to production and clear all the so far collected availability data, so my nagios history begin today. How can I do that?
2 Answers
According to the Nagios Support Forum here: Clear state, logs, etc. What is the best way?
Shut down the nagios service and remove the retention file:
service nagios stop
rm /usr/local/nagios/var/retention.dat
service nagios start
Delete the archived nagios.log files:
/usr/local/nagios/var/archives/
That said, I've never actually done either of these in any Nagios environment...so make sure you backup the folders/files first somewhere and then try it and verify it did what was intended.

- 32,627
- 26
- 132
- 191
It could be that when the service was removed, it did not get removed from the retention.dat file or the objects.cache file.
/usr/local/nagios/var/retention.dat /usr/local/nagios/var/objects.cache
When nagios starts, it reads those files for the running configurations and for the status when the system was shutdown. What you could do is to stop the Nagios daemon, edit those files and remove the entry and start the Nagios Daemon when you are done.
In my case I've just moved those files into other place (home folder, for example):
$ sudo systemctl stop nagios
$ sudo mv /usr/local/nagios/var/retention.dat ~/
$ sudo mv /usr/local/nagios/var/objects.cache ~/
$ sudo systemctl start nagios
And it looked like I've started nagios the first time.

- 499
- 1
- 6
- 14