Page 1 of 1

nagios backups

Posted: Wed Sep 05, 2012 11:57 am
by benhank
Fellas
I have read the documentation, but I am a little confused about the nagios backup script. does running

Code: Select all

/usr/local/nagiosxi/scripts/backup_xi.sh
perform a bare metal backup?
that is, after I reinstall the OS and Nagios, after I run that backup script will I have to do anything else, such as reinstall anything like pluginst, groups ect?
So for example, my network admin spider sense starts tingling, and I run that script, and archive the BU on a different machine.
I come in the next day and instead of seeing my server, I see a hand written note saying: "hah! hah! I stole your server."
Can I then reinstall the os and nagios, and use that backup to fully restore my setup?
If not is there a script or doc's that will show me how to recover from a situation like that?

Re: nagios backups

Posted: Wed Sep 05, 2012 1:26 pm
by scottwilkerson
benhank wrote:Can I then reinstall the os and nagios, and use that backup to fully restore my setup?
This is exactly what this is for. You would reinstall the OS (same arch as you had when you backed up) then reinstall Nagios XI.
Then you run

Code: Select all

/usr/local/nagiosxi/scripts/restore_xi.sh xxxx.tar.gz
This will restore all of your configurations/databases/plugins.

Re: nagios backups

Posted: Wed Sep 05, 2012 1:40 pm
by benhank
thanks, I was asking because the last couple of restores I did had issues. But looking back that happened because we backed up on a 32bit (we didnt know) os and tried to restore on a 64bit.
you can close the topic and thanks. BTW i did the backup and restore and it worked.

Re: nagios backups

Posted: Wed Sep 05, 2012 2:35 pm
by benhank
I spoke too soon =(. after doing the backup and restore to my new server, when i hit apply configuration, I get a configuration error, but the snapshot shows no errors. I even went into ccm and did a check configuration, but same thing 6 warnings 0 errors but apply config bombs out. I also checked the machine i'd just backed up, apply config works.
On the new server I changed the IP, but still no go.

Re: nagios backups

Posted: Wed Sep 05, 2012 4:50 pm
by scottwilkerson
This could be a couple things depending on what the error says.

Lets do the following, run

Code: Select all

rm -f /usr/local/nagiosxi/scripts/nagiosql.*
and adjust the max_execution time in your php.ini according to
http://support.nagios.com/wiki/index.ph ... _Completes

Re: nagios backups

Posted: Wed Sep 05, 2012 4:58 pm
by lmiltchev
Since you've been changing architectures, have you followed the steps outlined in the "Things to consider" section of our Backing Up And Restoring XI document?

Re: nagios backups

Posted: Wed Sep 05, 2012 4:59 pm
by benhank
sorry bro, for once I did the impossible,... I searched the forums and ended up at the F.A.Q:

Code: Select all

 Apply Configuration Page Stalls Out, Never Completes

If you attempt to Apply Configuration and you're seeing the following output:

 * Configuration submitted for processing...
 * Waiting for configuration verification.................. 

and the configuration never applies, the page may be timing out. If you've recently updated XI, try restarting the server first. If you're currently running Nagios XI 2011R1.3 there is a known bug that can cause this issue. You'll need to upgrade to the latest version to resolve the issue. If that does not resolve the issue, try editing the configuration for your PHP settings. Open /etc/php.ini file in a text editor and increase the following values.

Scroll all the way down to the bottom of the script, and remove a line that says:

 memory_limit = 64M      ; Increase the memory limit

Then scroll up to around line 300, and increase the numbers for the following configs.

 ;;;;;;;;;;;;;;;;;;;
 ; Resource Limits ;
 ;;;;;;;;;;;;;;;;;;;

 max_execution_time = 60     ; Maximum execution time of each script, in  seconds
 max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
 memory_limit = 256M      ; Maximum amount of memory a script may consume 


After this, run:

 service httpd restart

Then I rebooted, and viola! all set!


you guys can lock this .