How to restore nagios configuration from backup

Requirement :

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

Solution:

Normally you should have daily (or frequency of your choice i.e. weekly, hourly etc.) backups scheduled for tool configuration. 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.

After restore to make sure, ownerships are well in place, run below command

Lastly restart nagios to take up restored configuration.

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

Any thoughts?