Page 1 of 1

back up script question and request

Posted: Fri Oct 05, 2012 5:14 pm
by benhank
Nagios has an auto back up that runs everyday, It does it without having to shutdown the services and stuff. When I look at the file that results from running:

Code: Select all

/usr/local/nagiosxi/scripts/backup_xi.sh

the file it creates is xyz.tar.gz, and induces the entire nagios directory structure. But the script that does the daily/weekly/ monthly backups creates files that are broken down to nagios's separate parts.

i am confused about why the two scripts backup nagios differently, and why I can run one script with nagios running, and have to shut it down for another.

The restore process for the
Code: Select all

Code: Select all

  /usr/local/nagiosxi/scripts/backup_xi.sh
is so easy even I can do it.
But how do I restore files from the from the D,W,M backup?


If this next question is out of the scope of this support forum(and i think it is, but I am throwing my self on you folk's mercy), can someone help me rewrite both scrips or show me what to edit in the scripts so that they will include the folders listed below, and then push the files to a remote server? again if that is going to far i understand.

Code: Select all

/store/backups/*
/usr/local/nagiosxi/nom/checkpoints/*
/usr/local/nagvis/*
/etc/mrtg/mrtg.cfg
/var/lib/mrtg/*
Thanks in advance.

Re: back up script question and request

Posted: Mon Oct 08, 2012 9:20 am
by scottwilkerson
The daily/weekly/ monthly backups are just backups of all the mysql and postgres databases, not the full XI.

The backup script shouldn't be directly modifies because the backup and restore scripts get overwritten with upgrades. It would be best to define the steps you want done in a separate script that can be run on it's own cron job.
benhank wrote:If this next question is out of the scope of this support forum
It somewhat is as this is going to be dependent on your environment, which is part of why this isn't in place.

You can write a script that includes a call to /usr/local/nagiosxi/scripts/backup_xi.sh so it is all done in one place at the frequency you require.

Re: back up script question and request

Posted: Tue Oct 09, 2012 10:00 am
by benhank
scottwilkerson wrote:The daily/weekly/ monthly backups are just backups of all the mysql and postgres databases, not the full XI.

The backup script shouldn't be directly modifies because the backup and restore scripts get overwritten with upgrades. It would be best to define the steps you want done in a separate script that can be run on it's own cron job.
That's a good point, I hadn't thought of that. My problem is I have no clue how to write a script like that. BUT I will google it.
have you guys added a "backup feature " to the new nagios?

Re: back up script question and request

Posted: Tue Oct 09, 2012 10:17 am
by mguthrie
For those additional directories, I would look at using rsync to sync those files onto another machine. Rsync takes a little bit of setup work, but once it's in place its really nice. Here's a tutorial that includes how to script an rsync backup.
http://troy.jdmz.net/rsync/index.html

Re: back up script question and request

Posted: Tue Oct 09, 2012 10:28 am
by benhank
HEY thanks! this is awesome!

The problem with not having the linux background is that linux is a bit intimidating to the "windoze usah's" it's like one false move and boom.
Nagios Core forces you to know the command lines and stuff, But IX is so slick, It's makes you think that all you need to do is add a plugin here or just click there. So when a windows guy realises that he may have to get under the hood, we end up staring at that big black screen with all those scary letters and commands...

So, it feels safer to just beg you guys to help with the stuff we should google ourselves. Well, at least until you DO use google and get a hundred results that all say something different...

OMG, I just an inspiration for a whole ne genre of horror stories" It was a dark and stormy night, my pager went off. I woke and logged into the vpn only to see that half the enterprise was down. I was home , alone, The SLA clock was ticking. I remembered this issue, so I fired up putty, and remembered : all my notes were at the office 50 miles away. then I stared at the screen, the curser was blinking blinking blinking..."

LOL
Hey thanks guys, you can lock this mutha.

Re: back up script question and request

Posted: Tue Oct 09, 2012 10:55 am
by mguthrie
Lol, we're here for both the windows and the linux shops, no worries ;)