Does a scheduled local system backup dump remote DB?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
skynardo
Posts: 136
Joined: Tue Sep 18, 2012 8:59 am
Location: St. Louis, MO

Does a scheduled local system backup dump remote DB?

Post by skynardo »

I am trying to confirm that my remote MySQL database is being backed up by whatever script is running when I schedule a nightly local system backup via XI admin tab. I'm looking through one of the tar files but not sure what to look for to verify.

Thanks
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Does a scheduled local system backup dump remote DB?

Post by tgriep »

In the tar file, you should see the dump file called nagios.sql you can look at that to see if the settings are in it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Does a scheduled local system backup dump remote DB?

Post by jdalrymple »

Yes.

To verify, look for some size in the following part of the tar:

Code: Select all

[root@localhost nagiosxi]# tar -ztvf 1429221810.tar.gz  | grep mysql
drwxr-xr-x root/root         0 2015-04-16 17:03 1429221810/mysql/
-rw-r--r-- root/root    261730 2015-04-16 17:03 1429221810/mysql/nagios.sql
-rw-r--r-- root/root    273490 2015-04-16 17:03 1429221810/mysql/nagiosql.sql
If those 2 '.sql' files are small then your backup of the SQL db isn't working.
skynardo
Posts: 136
Joined: Tue Sep 18, 2012 8:59 am
Location: St. Louis, MO

Re: Does a scheduled local system backup dump remote DB?

Post by skynardo »

Here are my .sql files from last night's back ups, so I can assume all is well?

drwxr-xr-x nagios/nagios 0 2015-04-17 01:00 nagiosxi.1429250402/mysql/
-rw-r--r-- nagios/nagios 85221107 2015-04-17 01:00 nagiosxi.1429250402/mysql/nagios.sql
-rw-r--r-- nagios/nagios 495198 2015-04-17 01:00 nagiosxi.1429250402/mysql/nagiosql.sql

Thanks both of you for the help.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Does a scheduled local system backup dump remote DB?

Post by jdalrymple »

That looks small, how big is your environment?
skynardo
Posts: 136
Joined: Tue Sep 18, 2012 8:59 am
Location: St. Louis, MO

Re: Does a scheduled local system backup dump remote DB?

Post by skynardo »

Im in the process of rolling this out. Right now have roughly 150 hosts and 500 services.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Does a scheduled local system backup dump remote DB?

Post by jdalrymple »

Hmmm...

The backup script really should be grabbing your remote database. Maybe it just looks small to me but really isn't. The only way I'd for sure trust my backup is to do a restore.

1) Backup
2) Build new CentOS server - install XI
3) scp backup tar file to new server
4) Disable NIC (You don't actually want to monitor and alert with this test)
5) Run restore script on backup file
6) /etc/init.d/nagios stop
7) Login to XI interface and verify your configuration/perfdata/etc.
8) Destroy test server
skynardo
Posts: 136
Joined: Tue Sep 18, 2012 8:59 am
Location: St. Louis, MO

Re: Does a scheduled local system backup dump remote DB?

Post by skynardo »

You are right, I need to do this anyway, thanks for the step by step. Will try to get this done this week and post results.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Does a scheduled local system backup dump remote DB?

Post by abrist »

Great, keep us posted.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
skynardo
Posts: 136
Joined: Tue Sep 18, 2012 8:59 am
Location: St. Louis, MO

Re: Does a scheduled local system backup dump remote DB?

Post by skynardo »

I finally got around to getting this done today. I built a new test box and restored last nights backup (from my prod nagios server which has a remote msyql database) to my new test machine using the local mysql instance that gets installed with nagiosxi fullinstall.

The main problem I ran in to was on my test machine I found I was missing the mysql nagios user and instead had a ndoutils user? I had to create a nagios user@localhost and grant usage and privileges for it and then was able to login to Nagios and see that I had a successful recovery. I'm going to run through this again tomorrow to make sure I have the steps documented and see if I run into the same issue. Has anyone seen this before?
Locked