Lost services when upgrade failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Lost services when upgrade failed

Post by rickwilson7425 »

I tried to run the upgrade from 2014R1.0 to R1.1 and it failed.

I restored from tape backup but now I only have a few services displaying whereas I had about 40 or so before. This is on my test migration system so fortunately there aren't that many active servers or services on it.

The write and verify of configuration come up clean but it only writes 8 services for 10 hosts. The hosts and all their services are marked as active in CCM.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Lost services when upgrade failed

Post by Box293 »

Try deleting all the host and service definition flat files.

Code: Select all

rm -f /usr/local/nagios/etc/services/*.cfg
rm -f /usr/local/nagios/etc/hosts/*.cfg
Once you've done this, go into CCM and under Quick tools click Apply Configuration (this will re-create all of the host and service definition flat files).

Did this fix your problem?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Re: Lost services when upgrade failed

Post by rickwilson7425 »

That did not help.

Odd thing about this is that I can use the Write Config tool and I get no errors. If I use the Apply Configuration tool it fails.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Lost services when upgrade failed

Post by slansing »

What does the apply configuration tell you specifically when it errors out? There is a possibility that it is spitting out a DB error as opposed to a configuration error.
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Re: Lost services when upgrade failed

Post by rickwilson7425 »

It says:

Applying Configuration

Command submitted for processing...
Waiting for configuration verification.................................................................
Configurations failed to write to file.

An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Lost services when upgrade failed

Post by sreinhardt »

Please apply config again, after the failure go to CCM->Monitoring Config Snapshots (on the left)->from the top red line, open the second icon from the left (should look like a piece of paper with a small corner folded). Paste the output from that file into the forum. Please remember to use

Code: Select all

 wraps for large output or just attach instead of pasting.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Re: Lost services when upgrade failed

Post by rickwilson7425 »

This is the list of config snapshots:


Date Snapshot Result File Actions
06/17/2014 08:00:01 Config Ok 1403013601.tar.gz Download View Output Restore Archive
06/16/2014 07:59:01 Config Ok 1402927141.tar.gz Download View Output Restore Archive
06/15/2014 07:58:01 Config Ok 1402840681.tar.gz Download View Output Restore Archive
06/14/2014 07:57:02 Config Ok 1402754222.tar.gz Download View Output Restore Archive
06/13/2014 07:56:02 Config Ok 1402667762.tar.gz Download View Output Restore Archive
06/12/2014 07:55:02 Config Ok 1402581302.tar.gz Download View Output Restore Archive
06/11/2014 07:54:01 Config Ok 1402494841.tar.gz Download View Output Restore Archive
05/28/2014 12:06:23 Config Error 1401300383.tar.gz Download View Output Delete
05/28/2014 12:04:45 Config Error 1401300285.tar.gz Download View Output Delete
05/28/2014 10:27:38 Config Ok 1401294458.tar.gz Download View Output Restore Archive
05/28/2014 10:27:08 Config Error 1401294428.tar.gz Download View Output Delete
05/28/2014 10:24:01 Config Ok 1401294241.tar.gz Download View Output Restore Archive
05/28/2014 10:23:10 Config Ok 1401294190.tar.gz Download View Output Restore Archive
05/23/2014 10:47:25 Config Error 1400863645.tar.gz Download View Output Delete
05/22/2014 10:04:45 Config Error 1400774685.tar.gz Download View Output Delete
05/22/2014 10:03:49 Config Error 1400774629.tar.gz Download View Output Delete
05/22/2014 09:57:46 Config Error 1400774266.tar.gz Download View Output Delete
05/22/2014 09:55:06 Config Error 1400774106.tar.gz Download View Output Delete
05/22/2014 09:54:01 Config Error 1400774041.tar.gz Download View Output Delete
05/22/2014 09:53:40 Config Error 1400774020.tar.gz Download View Output Delete


As you can see there isn't a failure file to open at the top of the list.

Here is what the config snapshot at the top of the list says:

Nagios Core 4.0.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-29-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 11 services.
Checked 10 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 194 contacts.
Checked 34 contact groups.
Checked 176 commands.
Checked 9 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 10 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 9 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Lost services when upgrade failed

Post by Box293 »

Can you please tell us what the Error is in this snapshot file or attach it please?

05/28/2014 12:06:23 Config Error 1401300383.tar.gz
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rickwilson7425
Posts: 125
Joined: Tue Mar 18, 2014 3:20 pm

Re: Lost services when upgrade failed

Post by rickwilson7425 »

I fixed the error that it indicates.

It says:


Nagios Core 4.0.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-11-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Unexpected start of object definition in file '/usr/local/nagios/etc/commands.cfg' on line 339. Make sure you close preceding objects before starting a new one.
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Lost services when upgrade failed

Post by Box293 »

rickwilson7425 wrote:I fixed the error that it indicates.
Did you resolve this or do you still need help?

If you need help, please attach the file '/usr/local/nagios/etc/commands.cfg'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked