Error when backing up before upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Error when backing up before upgrade

Post by agriffin »

Can you try running tar with the verbose flag as nscott suggested?
c0ldf1r3
Posts: 22
Joined: Thu May 05, 2011 8:34 pm

Re: Error when backing up before upgrade

Post by c0ldf1r3 »

I did run that command and posted my results:
---------------------------------
Scott,
I tried to run the command above but got the same results.

I execute the command and it never returns to the login prompt.

Any advice.

Regards
----------------------------------

I gave up trying to do what should be a simple upgrade and took the system out of production. :roll:

too many headaches and problems.
c0ldf1r3
Posts: 22
Joined: Thu May 05, 2011 8:34 pm

Re: Error when backing up before upgrade

Post by c0ldf1r3 »

Even when I try to execute the following commands for the upgrade I get an error:

[root@nagxi ~]# service nagiosxi stop
[root@nagxi ~]# service npcd stop
NPCD Stopped.
[root@nagxi ~]# service ndo2db stop
Stopping ndo2db: done.
[root@nagxi ~]# service nagios stop
Stopping nagios: ./etc/init.d/nagios: line 182: kill: (15972) - No such process
done.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Error when backing up before upgrade

Post by nscott »

c0ldf1r3,

I'm curious as to what the output of the tar with the verbose flag was. How far did it get? Or did it just sit blank? I'm not seeing a post that contains that information, but it would be helpful information for diagnosing your issue.

Well the good news is that did actually stop the nagios process. The less good news is that implies that there were multiple nagios -d processes running concurrently. While that is not a good thing, it IS a good thing that that would definitely show up in the nagios logs. There should be something toward the bottom (after you stopped this service, if its a long time and you restarted and have a lot of checks running it would) about what failed. The dual running processes might even explain why the backup was hanging.

In summary, check the logs, and do a dump of them on here if you wish, and bring us up to speed on exactly what happened when you ran the tar job with a verbose flag.
Nicholas Scott
Former Nagios employee
c0ldf1r3
Posts: 22
Joined: Thu May 05, 2011 8:34 pm

Re: Error when backing up before upgrade

Post by c0ldf1r3 »

after I ran and then manually stopped the process from this morning until this afternoon the file is:

rw-r--r-- 1 root root 52690944 Aug 3 13:21 usr-local-nagios.tar.bz2

Which logs are you looking for as I would be happy to provide them. Anything to try and get this resolved.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Error when backing up before upgrade

Post by nscott »

The log I'm talking about is /usr/local/nagios/var/nagios.log, however I missed the part where you had 18 million files. There is no quick way to compress that many files, short of using a faster compression scheme like gzip, which is, at least 2x as fast, but doesn't have near the compression ratio.
Nicholas Scott
Former Nagios employee
c0ldf1r3
Posts: 22
Joined: Thu May 05, 2011 8:34 pm

Re: Error when backing up before upgrade

Post by c0ldf1r3 »

so my basic question is why would such a small install of nagios be impossible to upgrade??

if there is no way to follow the script outlined for upgarding what is the purpose?
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Error when backing up before upgrade

Post by nscott »

The upgrade itself will actually work and will most likely not destroy your data. The backup is for disaster recovery in case the unthinkable happens. The backup is for safety reasons, which you are not required to do to properly upgrade the Nagios XI instance. You are also not required to back it up in the same fashion that is outlined in the document, if you are confident in the backup methods that you have installed, then you won't have to worry about backing it up as described in the doc. Most people I talk to about backups have Nagios running in a virtualized environment, and take snapshots as opposed to backing it up.

If however, you do not have a backup solution, and wish to backup then before an upgrade is an idea time. It is a time consuming task to backup a large set of files, and the way referenced in the doc is a sure fire way to backup, however it will take a while, but it will work for every install. You can try reducing the compression ratio by using different methods, but any way you slice it, if you want to backup something with so many files, it will take a while. You could try using a lower compression ratio or a different method for compressing (tar.gz instead of tar.bz2), infact, lzop is very fast, this will be the fastest compression method for you. Please be sure that you have enough hard disk space for a backup.

yum install lzop -y
tar --use-compress-program=lzop -cvf /tmp/backupcore.tar.lzo /usr/local/nagios/*
tar --use-compress-program=lzop -cvf /tmp/backupxi.tar.lzo /usr/local/nagiosxi/*
mysqldump -u root -pnagiosxi nagios > /tmp/nagios.sql
mysqldump -u root -pnagiosxi nagiosql > /tmp/nagiosql.sql
Nicholas Scott
Former Nagios employee
Locked