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
Does a scheduled local system backup dump remote DB?
Re: Does a scheduled local system backup dump remote DB?
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?
Yes.
To verify, look for some size in the following part of the tar:
If those 2 '.sql' files are small then your backup of the SQL db isn't working.
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.sqlRe: Does a scheduled local system backup dump remote DB?
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.
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?
That looks small, how big is your environment?
Re: Does a scheduled local system backup dump remote DB?
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?
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
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
Re: Does a scheduled local system backup dump remote DB?
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.
Re: Does a scheduled local system backup dump remote DB?
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.
"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.
Re: Does a scheduled local system backup dump remote DB?
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?
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?