Configurations are saved to a subversion repository when a configuration is successfully applied, so the repository only contains valid configurations.
Reverting to a previous configuration is not possible using the REST interface or the Web interface, although this feature is planned for inclusion, but it is possible using the command line.
The following are steps required to revert to a previous configuration:
This example assumes that the environment is named 'local' and the nagios
configuration directory is in /etc/nagios
.
NOTE that the repository should only be changed on the slave node for distributed environments.
Log into the nagios server then,
cd svn co file:///etc/nagios/repos/local
cd local/ svn log | less
Only choose revisions with the comment, 'Changes saved'.
View the differences with svn diff -r REVISION
.
svn up -r REVISION
lockfile -! -1 -r 120 /etc/nagios/objects/local/setup/directory.lock
The Web interface should now be completely unresposive when the page is refreshed. If the Web interface still works then check the path in the previous command.
List the directory contents before copying and ensure the permissions remain the same.
ls -l /etc/nagios/objects/local/setup/ cp *.setup /etc/nagios/objects/local/setup/ ls -l /etc/nagios/objects/local/setup/
rm /etc/nagios/objects/local/setup/directory.lock
The Nagrestconf Web interface will be responsive again. Visually check the configuration.
Either 'Revert Changes', to back out, or 'Apply Changes' to accept the new configuration