Restore script errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
BenCowan
Posts: 86
Joined: Thu Jul 28, 2011 11:34 am

Restore script errors

Post by BenCowan »

At some point the Backup and Restore scripts changed from using zip/unzip to gzip/tar, and ever
since I get the following errors:

tar: nagiosxi_backup/nagios.tar.gz: Not found in archive
tar: Error exit delayed from previous errors

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: usr/local/nagios/bin/nagios: Not found in archive
tar: Error exit delayed from previous errors
WARNING: you are trying to restore a backup on a 64-bit system
Plugins and other binaries will NOT be restored.

Can NagiosXI also include the option to use the old method of backup and restore?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Restore script errors

Post by slansing »

What version of Nagios XI are you currently running, and what version was the backup you are trying to restore made from?
BenCowan
Posts: 86
Joined: Thu Jul 28, 2011 11:34 am

Re: Restore script errors

Post by BenCowan »

Both the backup and restore were Nagios XI 2012R1.3
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restore script errors

Post by scottwilkerson »

The restore script expects that the file hasn't been renamed

If you look in the tarball you will see that the inside it is named with a timestamp

If you rename your nagios.tar.gz file to the appropriate {timestamp}.tar.gz it should work fine.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
BenCowan
Posts: 86
Joined: Thu Jul 28, 2011 11:34 am

Re: Restore script errors

Post by BenCowan »

Thanks, that was it.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Restore script errors

Post by jbennett »

I have run into this same issue on 1.4.

I have extracted the nagios.tar.gz file from my backup, but I'm not seeing a time stamped file within that tar ball?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restore script errors

Post by scottwilkerson »

Actually, the backup script will make a file like 1348511708.tar.gz

If you rename this file to nagiosxi.tar.gz, in order to find out what you need to rename it back to you would need to run

Code: Select all

gunzip nagiosxi.tar.gz
then

Code: Select all

ls -l
total 202776
-rw-r--r-- 1 root root 95129600 Sep 24 13:35 1348511708.tar
-rw-r--r-- 1 root root 61867430 Nov 28 12:46 nagiosxi.tar.gz
Yo will see you now have 1348511708.tar

1348511708.tar.gz is what you would need to rename the file to.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Restore script errors

Post by jbennett »

Code: Select all

# mv 1358874071.tar.gz nagiosxi.tar.gz
# gunzip nagiosxi.tar.gz
# ls -l
total 1527672
-rw-r--r-- 1 root root 1535805440 Jan 22 12:00 nagiosxi.tar
Unfortunately, I don't get that same result.

Looking at your example, the time stamp is the same as the original file name, couldn't I just rename nagiosxi.tar as 1358874071.tar then gzip it again?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restore script errors

Post by scottwilkerson »

likely yes
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Restore script errors

Post by jbennett »

So, I'm just renaming the original file to the original name? Apparently, somewhere along the way, I've gotten lost...

Code: Select all

# mv nagiosxi.tar 1358874071.tar
# gzip 1358874071.tar
# ls -lh
total 1.1G
-rw-r--r-- 1 root root 1.1G Jan 22 12:00 1358874071.tar.gz
# /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1358874071.tar.gz
tar: 1358874071/nagios.tar.gz: Not found in archive
tar: Error exit delayed from previous errors

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: usr/local/nagios/bin/nagios: Not found in archive
tar: Error exit delayed from previous errors
WARNING: you are trying to restore a  backup on a 64-bit system
         Plugins and other binaries will NOT be restored.

Are you sure you want to continue? [y/N]
I should note that within the 1358874081.tar.gz file, I do have nagios.tar.gz already.
Locked