Page 1 of 2

tar: /usr/../nagios.log: file changed a we read it

Posted: Tue Apr 17, 2012 2:41 pm
by jbennett
I am attempting to back up our current nagios installation in order to upgrade to the latest version. While following the steps outlined here: http://assets.nagios.com/downloads/nagi ... ctions.pdf

I type:

Code: Select all

tar cjf /root/pre-upgrade-backup/usr-local-nagios.tar.bz2 /usr/local/nagios
I get the following:

Code: Select all

tar: Removing leading '/' from member names
tar: /usr/local/nagios/var/nagios.log: file changed as we read it
The process seems to hang here, or it's just taking a very long time. I'm assuming that this log file is written to constantly, and that the file changing as we read it isn't necessarily a critical error? However, it seems that the process is hanging after this point. Is this normal?

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Tue Apr 17, 2012 2:55 pm
by jbennett
Checking the file size via SCP, I see it continuing to grow. I'm guessing that it's still working int he background then.

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Tue Apr 17, 2012 4:35 pm
by scottwilkerson
That sounds right.

You did stop the services like it said in the doc right?

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Wed Apr 18, 2012 11:41 am
by jbennett
I did. However, I did get a notice that nagios didn't stop in a timely manner.

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Wed Apr 18, 2012 2:02 pm
by scottwilkerson
Ok, then it is probable still running...

Did the backup complete?

If not you may need to stop the backup process and do this one more time, if you get the nagios didn't stop in a timely manner error, run this before proceeding

Code: Select all

killall -9 nagios

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Wed Apr 18, 2012 4:21 pm
by jbennett
I realize this might be obvious, but I need to ask.

The directions indicate that you should start all of the services back up after doing your back up and apply the update with Nagios running. This seems incorrect, is it?

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Wed Apr 18, 2012 4:47 pm
by scottwilkerson
It is correct.

We only want to stop the services while doing the backup so the data is constant.

The upgrade can run while the services are running.

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Thu Apr 19, 2012 8:51 am
by jbennett
The upgrade went through successfully. Now to try and resolve phantom associations with phantom hosts, contacts, and services....:(

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Thu Apr 19, 2012 9:08 am
by scottwilkerson
When you say "phantom hosts, contacts, and services"

Do you mean you don't see them in the CCM but are getting errors trying to delete items?

Although rare, I have seen this if for some reason their are cfg file that haven't been deleted correctly.

If you Go to Configure -> Core Config Manager -> Write Config Files
Click the top 2 items

Then from the console run

Code: Select all

cd /usr/local/nagios/etc
find hosts/*.cfg services/*.cfg -mmin +60
This will list any hosts and services configuration files that are older than 60 minutes. These likely need to be manually deleted as they were not written from the the CCM.

Re: tar: /usr/../nagios.log: file changed a we read it

Posted: Thu Apr 19, 2012 1:04 pm
by jbennett
I managed to get this one figured out...for the most part.

I have one host with a service attached to it still though. It shouldn't be as I've triple checked that service and don't find it listed in the host list of that service.

What else can I check? I did the write config, etc. as you pointed out, but this one still shows up and it shouldn't.