Snapshot restore

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nod2002
Posts: 5
Joined: Tue Feb 02, 2010 2:19 pm

Snapshot restore

Post by nod2002 »

Is there an easy way to restore a config snapshot in the event that a config apply fails? I'm trying to debug a config import issue and need an easy way to blow away the nagios QL db.
nod2002
Posts: 5
Joined: Tue Feb 02, 2010 2:19 pm

Re: Snapshot restore

Post by nod2002 »

Looking at the documentation, another method looks to do a restore of the DB data from;

/store/backups/mysql
/store/backups/postgresql

Has anyone else used this method?
User avatar
admin
Site Admin
Posts: 256
Joined: Mon Oct 12, 2009 8:21 am

Re: Snapshot restore

Post by admin »

Do you want to blow away the NagiosQL database on a configuration failure? Nagios XI will automatically roll-back the exported config files that are used for monitoring when it detects a problem. The NagiosQL database, however, is left untouched so you can make changes and resolve errors.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Ethan Galstad
President
awatch
Posts: 18
Joined: Thu Mar 25, 2010 8:01 am

Re: Snapshot restore

Post by awatch »

I have the same conundrum. I'm not concerned about the flat files being replaced, I want to roll back the database to a clean config and start the import process over so I don't have issues with duplicate imported definitions (overwrite doesn't seem to be working.) Is there not a simple way to restore the database to a backup? If you import configuration errors there's no better way to resolve it than fix each entry in the database as opposed to rolling back and importing a proper configuration? Any advisement would be helpful.

Thanks
awatch
Posts: 18
Joined: Thu Mar 25, 2010 8:01 am

Re: Snapshot restore

Post by awatch »

Still absolutely nothing on this?
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Snapshot restore

Post by mmestnik »

Databases can rollback transactions, however once a transaction is committed this is not possible.

The solution I've always used is to avoid databases, SQL in particular but LDAP and XML are also not well suited for managing configurations. Revision Control System(rcs, cvs, svn, git, "ect") are all vary well suited to managing configuration changes and all have the ability to rollback changes, even more useful is the ability to compare/review changes made between revisions and remove a single change, even if it was made a long time ago. Both raising awareness of what exactly is configure removing the need in most cases to rollback changes and in other cases making a simple 'undo' possible.

As for what you can be done with NagiosQL, It would be much easier to dispose of(shut it down and/or pause, turn off) the existing install and start anew. Sadly this is the trade-off made when working with most GUI(s), so it's become and accepted practice.

Your other options include removing tables from the database and reloading them from an SQL dump of a pristine(made from an install image) database dump. I believe such a dump would have to be included as part of the install tarball.
Locked