nagios backup script question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

nagios backup script question

Post by benhank »

Hello all!
What do I need to do to make the nagios backup script use regular time instead of unix time?
And would I have to make any changes to the restore script?
(stop laffin..)
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios backup script question

Post by abrist »

Copy the script first as XI upgrades will overwrite it (DISCLAIMER - When we change the script for necessary upgrades, you will have to reapply the following, assuming the following will still work):

Code: Select all

cp /usr/local/nagiosxi/scripts/backup_xi.sh /usr/local/nagiosxi/scripts/backup_xi_benhank_style.sh
On line 110 of the script backup_xi_benhank_style.sh, add the following:

Code: Select all

bhts=$(date +"%m-%d-%y")
mv $ts.tar.gz "$bhts".tar.gz
echo "Backup is actually stored in $rootdir/$bhts.tar.gz"
echo "*Not* where the script will tell you it is below, it lies!"
bhts = benhank timestamp or better human timestamp :P

As always, give it a test. The restore procedure should work as it grabs the filename passed to it and loads it into a variable. As there are no spaces in this name, it should work ok, though it does not include hours, minutes, etc. Let me know if you have issues with it.
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.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nagios backup script question

Post by benhank »

bhts = benhank timestamp or better human timestamp :P
As they day in the shaft song" You >censored< riiiight!"

thanks you can lock it up. =D
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios backup script question

Post by abrist »

THEN WE CAN DIG IT!
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.
Locked