Remove overrides in retention.dat
Remove overrides in retention.dat
Hello,
It seems someone has used the web interface to override whether notifications are enabled on certain services/hosts in the past. We're currently modifying the configuration files to disable some notifications on certain services, however I have noticed a variety of different hosts that use these services still have the notifications enabled for them.
After further digging, I learned nagios keeps "overrides" from the interface in the status.dat/retention.dat files. I thought I would simply be able to "undo" the change by reverting the notification state on the web interface, however it still sees it as a "modified attribute" in the retention.dat file.
is there anyway for me to remove these overrides so it starts inheriting directly from the configuration file again?
Thank you and Happy Christmas to you all!
It seems someone has used the web interface to override whether notifications are enabled on certain services/hosts in the past. We're currently modifying the configuration files to disable some notifications on certain services, however I have noticed a variety of different hosts that use these services still have the notifications enabled for them.
After further digging, I learned nagios keeps "overrides" from the interface in the status.dat/retention.dat files. I thought I would simply be able to "undo" the change by reverting the notification state on the web interface, however it still sees it as a "modified attribute" in the retention.dat file.
is there anyway for me to remove these overrides so it starts inheriting directly from the configuration file again?
Thank you and Happy Christmas to you all!
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Remove overrides in retention.dat
What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use. Those questions will help us determine file paths so that we can help you.
How are these overrides being done? Are the hosts/services being acknowledged?
Assuming it's not an acknowledgement, are you seeing
How are these overrides being done? Are the hosts/services being acknowledged?
Assuming it's not an acknowledgement, are you seeing
when you send the enabling of the notifications? How long did you wait?Your command request was successfully submitted to Nagios for processing.
Note: It may take a while before the command is actually processed.
Re: Remove overrides in retention.dat
Hi dwhitfield,
It's running CentOS 6 and the files are located within currently. However I think there's a slightly misunderstanding.
The web interface actions properly update everything, my problem is undoing those actions so it then inherits properly from the configuration files on the system.
For example, "Memory Usage" service is set to in the configuration file that defines the services.
Host A & Host B both have "Memory Usage" as a service associated to them. I then use the web interface to disable notifications for the service on Host B. I then later re-enable them via the web interface.
The following week we decide that service no longer needs notifications, so we update the configuration file on the server to. This updates Host A to not have notifications enabled for that service, however Host B sees what we did the other day as something more important than this config file still. It no longer is inheriting from the config file.
How can I reset a service on a host to ignore all customisations via the web panel so it starts listening to the actual configuration file again?
Thanks
It's running CentOS 6 and the files are located within
Code: Select all
/var/log/nagios
The web interface actions properly update everything, my problem is undoing those actions so it then inherits properly from the configuration files on the system.
For example, "Memory Usage" service is set to
Code: Select all
notifications_enabled 1
Host A & Host B both have "Memory Usage" as a service associated to them. I then use the web interface to disable notifications for the service on Host B. I then later re-enable them via the web interface.
The following week we decide that service no longer needs notifications, so we update the configuration file on the server to
Code: Select all
notifications_enabled 0
How can I reset a service on a host to ignore all customisations via the web panel so it starts listening to the actual configuration file again?
Thanks
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Remove overrides in retention.dat
@dv2kJLUPv, When you talked about modifying the configuration files, did you actually mean modifying the retention.dat file? You need to stop the Nagios process before modifying the retention.dat file.
If that doesn't help you may do something like this:
/usr/local/nagios/etc/...
If that doesn't help you may do something like this:
I think a better way to do this would be to modify the configs inside the service and hosts definitions in:You also have to define the modified_attributes= directive so Nagios knows which entries in the retention.dat file will override the settings in the configuration files. This might seem overly complicated however this is normally controlled by the Nagios process, manually modifying the retention.dat is not commonly done.
https://support.nagios.com/kb/article.php?id=522
/usr/local/nagios/etc/...
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Remove overrides in retention.dat
@npolovenko No I have modified the actual configuration files (which for us are located in ); but these changes are not overriding the ones that have been "modified" in the retention.dat file.
Code: Select all
/etc/nagios/conf.d/
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Remove overrides in retention.dat
@dv2kJLUPv, The key here is to make sure that the Nagios process is stopped before you modify the retention file.
1.Stop nagios with
2.You may also run killall -9 nagiosto make sure there are no duplicate Nagios processes still running
3. After that, you may modify the retention file.
4. Start nagios with
Also, any time after you modify the config files manually, you need to restart the nagios service with:
This command will force Nagios to reach out to the config files and populate everything on the web interface side.
Let us know if that helped. Otherwise, I would like to see all the definition files from:
/etc/nagios/conf.d/. You may run the following command:
And when done you should have a definitions.tgz file in /tmp/ folder. Download that folder to your computer using WinSCP or FileZilla and upload it with your next post.
Regards
1.Stop nagios with
Code: Select all
service nagios stop
3. After that, you may modify the retention file.
4. Start nagios with
Code: Select all
service nagios start
Code: Select all
service nagios restart
Let us know if that helped. Otherwise, I would like to see all the definition files from:
/etc/nagios/conf.d/. You may run the following command:
Code: Select all
tar cvfz /tmp/definitions.tgz /etc/nagios/conf.d/*
Regards
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Remove overrides in retention.dat
Hi @npolovenko,
Hope you had a lovely Christmas and new year.
I still think there's a bit of confusion here, I do not want to change the retention file.
I want to know how to undo / revert any changes that have been applied through the web interface so that everything is a direct result of what's specified in the /etc/nagios/conf.d/ and not being inherited from the retention file.
I have tried restarting nagios, and it still keeps any changes applied through the web interface instead of using the actual config definitions.
Hope you had a lovely Christmas and new year.
I still think there's a bit of confusion here, I do not want to change the retention file.
I want to know how to undo / revert any changes that have been applied through the web interface so that everything is a direct result of what's specified in the /etc/nagios/conf.d/ and not being inherited from the retention file.
I have tried restarting nagios, and it still keeps any changes applied through the web interface instead of using the actual config definitions.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Remove overrides in retention.dat
If you don't want to retain your state, then you can turn off state retention.
-- https://assets.nagios.com/downloads/nag ... nformationFormat: retain_state_information=<0/1>
Example: retain_state_information=1
This option determines whether or not Nagios will retain state information for hosts and services between program restarts. If you enable this option, you should supply a value for the state_retention_file variable. When enabled, Nagios will save all state information for hosts and services before it shuts down (or restarts) and will read in previously saved state information when it starts up again.
0 = Don't retain state information
1 = Retain state information (default)