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..)
nagios backup script question
nagios backup script question
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
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
Re: nagios backup script question
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):
On line 110 of the script backup_xi_benhank_style.sh, add the following:
bhts = benhank timestamp or better human timestamp 
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.
Code: Select all
cp /usr/local/nagiosxi/scripts/backup_xi.sh /usr/local/nagiosxi/scripts/backup_xi_benhank_style.shCode: 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!"
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.
"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: nagios backup script question
As they day in the shaft song" You >censored< riiiight!"bhts = benhank timestamp or better human timestamp
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
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
Re: nagios backup script question
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.
"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.