Tag Archives: wato

How to restore nagios configuration from backup

Learn to restore Nagios configuration backup. If you messed up Nagios configuration, you can restore last known good config using these steps.

Restore Nagios configuration

Requirement

While troubleshooting or doing some configuration changes (R n D), sometimes you mess up the configuration in Nagios. This leads to no data dashboard. You need to revert back to the last known good configuration so that the tool can resume its work.

Also read: How to install & configure checkmk in Linux

Solution

Normally you should have daily (or frequency of your choice i.e. weekly, hourly, etc.) backups scheduled for tool configuration using services like cron. We will see how to configure this configuration backup in another article.

Now, navigate to the directory where configuration backups are kept. Normally they should be in gunzip format.

Once inside that directory run below restore command.

# check_mk --restore check_mk.11-Mar-2016.tar.gz

After restore to make sure, ownership is well in place, run below command

# chown -R apache:nagcmd /etc/check_mk/conf.d/wato/

Lastly, restart Nagios to take up restored configuration.

# check_mk -R --restart nagios-check_mk

Now go back to the dashboard and check its populated with values!