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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

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

Post 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?
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

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

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

That sounds right.

You did stop the services like it said in the doc right?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

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

Post by jbennett »

I did. However, I did get a notice that nagios didn't stop in a timely manner.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

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

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

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

Post by jbennett »

The upgrade went through successfully. Now to try and resolve phantom associations with phantom hosts, contacts, and services....:(
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

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

Post 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.
Locked