Dump and import dashboards, etc. to failover

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Dump and import dashboards, etc. to failover

Post by gormank »

Hi,
I dump the nagiosql DB and import it on the failover server as part of a cheap DR solution but I see dashboards aren't imported. I imagine there is more I need to do to to get my dashboards onto the DR host.

Can you provide info on what I need to do to get the dashboards from the primary to the failover host?

Thanks
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dump and import dashboards, etc. to failover

Post by ssax »

The only way this would work is if you did the same with the nagiosxi DB, there isn't currently a method to strip them out from one and put them into another system at this time unless you replace the entire nagiosxi DB which will overwrite your failover's XI settings with the production server's XI settings/users/etc, this is because the IDs in the data need to match and they won't unless they are the exact autoincrement/user ids that prod has.

Most just use the backup/restore functionality to make the failover system the same and then change Admin > Program URL after.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Dump and import dashboards, etc. to failover

Post by gormank »

I think I was doing a backup and restore in the past and it caused problems so I switched. I've been doing this for years w/o issues until I found the dashboards weren't being restored. Of course, the primaries have never failed and are only used during upgrades so far. Then again I do test periodically to make sure they're still working.

I want the users to be restored on the failover server because the people who manage users aren't able to remember to do so on both hosts in each env.

How can the program URL be changed or where is it stored? Obviously, it isn't practical to update it manually every 30 minutes when the restore is done.

What DB, schema, or whatever the term is are the dashboards stored in?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dump and import dashboards, etc. to failover

Post by ssax »

They are stored in the xi_usermeta table in the nagiosxi DB:

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi -e "select * from xi_usermeta where keyname like '%dashboards%';"
They are php serialized in case you want to review what they contain:

Code: Select all

https://www.unserialize.com/
You can update the Program URL like this:

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi -e "update xi_options set value = 'http://yoururl/nagiosxi/' where name = 'url';"
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Dump and import dashboards, etc. to failover

Post by gormank »

I copied a backup from the primary to the failover host, restored and verified the dashboards are now there. I'll update my script to copy a backup, restore and update the URL settings.
Feel free to close this.
Thanks!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Dump and import dashboards, etc. to failover

Post by benjaminsmith »

Hi @gormank

Great! We'll close this out.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked