Scheduled downtime being cleared when Nagios Restarts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wbright
Posts: 12
Joined: Thu May 17, 2018 9:31 pm

Scheduled downtime being cleared when Nagios Restarts

Post by wbright »

I have a corrupted retention.dat file so have updated nagios.cfg to use retention2.dat and have restored retention.dat to retention2.dat
Now the scheduled downtime settings are being wiped each time Nagios is restarted with the recurring downtime being resubmitted when the CRON jobs runs after the restart.
Can I restore the previous scheduled downtime settings and also ensure that new scheduled downtime settings are retained after the service restart.

-rw-rw-rw- 1 root root 483 Sep 27 2019 profile.csv
-rw------- 1 nagios nagios 21148201 Aug 26 10:21 retention2.dat
-????????? ? ? ? ? ? retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 Aug 26 09:21 rw
-rw-r--r-- 1 nagios nagios 5030 Aug 26 10:27 service-perfdata
drwxr-xr-x 5 nagios nagios 4096 Sep 27 2019 spool
drwxr-xr-x 2 nagios nagios 4096 Aug 26 10:26 stats
-rw-rw-r-- 1 nagios nagios 21102168 Aug 26 10:27 status.dat

Regards
William Bright
ITSM Consultant
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Scheduled downtime being cleared when Nagios Restarts

Post by pbroste »

Hello @wbright

Thanks for reaching out on the scheduled downtime issue. I tried to dupe the scheduled downtime on my test environment but was not able to replicate the issue.

We want to take a look at your Nagios XI System Profile so we can see what is going on.

To send us your system profile.
  • Login to the Nagios XI GUI using a web browser.
  • Click the "Admin" > "System Profile" Menu
  • Click the "Download Profile" button
  • Save the profile.zip file and share via private message
Thanks,
Perry
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Scheduled downtime being cleared when Nagios Restarts

Post by pbroste »

Hello @wbright

To follow up, we see that retention.dat is also hard coded in other places within the application code (for example; config.inc.php:$cfg['state_retention_file']='/usr/local/nagios/var/retention.dat')

Does not look like renaming it will work, you may want to copy it out instead.

Thanks,
Perry
wbright
Posts: 12
Joined: Thu May 17, 2018 9:31 pm

Re: Scheduled downtime being cleared when Nagios Restarts

Post by wbright »

Good afternoon Perry,
Thank you for the information but unfortunately I have been unable to copy, rename or remove the retention.dat file.
It looks like I am going to have to build a new server and restore the nagios backup.

Have a good day
Regards

William Bright
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Scheduled downtime being cleared when Nagios Restarts

Post by pbroste »

Hello William,

Are you able to read the retention.dat? If so you could 'cat' it and redirect to file? (cat /usr/local/nagios/var/retention.dat > /some/file.txt).

Let us know if you need anything further.

Thanks,
Perry
Locked