Configuration error after upgrade to 2.7

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Configuration error after upgrade to 2.7

Post by JakeHatMacys »

It's referencing a Host that no longer exists:

Code: Select all

Error: Could not find any host matching 'KSKE4165387' (config file '/usr/local/nagios/etc/services/KSKE4165387.cfg', starting on line 93)

Error: Failed to expand host list 'KSKE4165387' for service 'Uptime' (/usr/local/nagios/etc/services/KSKE4165387.cfg:93)
Any ideas?

I'm able to manually Delete, Write, then verify the config & restart Nagios on the Write Config Files (in that order).

So not sure what the issue is. Could this guy be ghosting around somewhere? Went onto the server and looked in usr/local/nagios/etc/hosts directory and not seeing that host at all either.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configuration error after upgrade to 2.7

Post by abrist »

Well, I doubt you will find an associated host as that is the error. Do you have any files in /usr/local/nagios/etc/static pertaining to this service?
Could you post the contents of:

Code: Select all

/usr/local/nagios/etc/services/KSKE4165387.cfg
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Configuration error after upgrade to 2.7

Post by ssax »

In addition to abrist's post, please post the output of the commands below:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Configuration error after upgrade to 2.7

Post by JakeHatMacys »

abrist wrote:Well, I doubt you will find an associated host as that is the error. Do you have any files in /usr/local/nagios/etc/static pertaining to this service?
Could you post the contents of:

Code: Select all

/usr/local/nagios/etc/services/KSKE4165387.cfg
Nothing in our static directory:

Code: Select all

[root@esu2v239 services]# cd /usr/local/nagios/etc/static
[root@esu2v239 static]# ls
xiobjects.cfg  xitemplates.cfg  xitest.cfg
[root@esu2v239 static]#
That's the kicker, we have all our services inherited via Host groups. At one time it probably had a service inherited from one.

We only have this in our services folder:

Code: Select all

[root@esu2v239 nagiosxi]# cd /usr/local/nagios/etc/services
[root@esu2v239 services]# ls
11.24.5.6.cfg        Agent Drive C: Disk Usage.cfg  Agent Uptime.cfg            localhost.cfg
Agent CPU Usage.cfg  Agent Memory Usage.cfg         esu2v733.federated.fds.cfg  Ping.cfg
[root@esu2v239 services]#


Results from reconfigure: (Ton of warnings about no contacts then this)

Code: Select all

        Checked 3132 hosts.
        Checked 783 host groups.
        Checked 2 service groups.
        Checked 9 contacts.
        Checked 2 contact groups.
        Checked 123 commands.
        Checked 16 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 3132 hosts
        Checked 0 service dependencies
        Checked 2332 host dependencies
        Checked 16 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 12592
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Applied config after the reconfigure and still getting the same error.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Configuration error after upgrade to 2.7

Post by jdalrymple »

JakeHatMacys wrote:Any ideas?
no!

That's really weird.

What works and what doesn't?
Apply config from web interface - doesn't work?
Delete, Write, Verify Restart - works?
reconfigure_nagios.sh - works?

Where is it you're actually seeing the error? I guess that's what has me most baffled. I'm assuming somewhere at some command line since you code-wrapped it, but it's not in reconfigure_nagios.sh
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Configuration error after upgrade to 2.7

Post by JakeHatMacys »

jdalrymple wrote:
JakeHatMacys wrote:Any ideas?
no!

That's really weird.

What works and what doesn't?
Apply config from web interface - doesn't work?
Delete, Write, Verify Restart - works?
reconfigure_nagios.sh - works?

Where is it you're actually seeing the error? I guess that's what has me most baffled. I'm assuming somewhere at some command line since you code-wrapped it, but it's not in reconfigure_nagios.sh
Only the Web UI is erroring, which is what we use the most:

Reconfigure.sh gives me:

Code: Select all

        Checked 3127 hosts.
        Checked 783 host groups.
        Checked 2 service groups.
        Checked 9 contacts.
        Checked 2 contact groups.
        Checked 123 commands.
        Checked 16 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 3127 hosts
        Checked 0 service dependencies
        Checked 2328 host dependencies
        Checked 16 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 12567
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
[root@esu2v239 scripts]#
Meanwhile the UI gives me:
Capture.JPG
This is happening on every server I upgrade from 2.5 btw, (ghosting of an old device or service) it happened when I tried to go to 2.6 and I ended up just rolling back and not upgrading because I've had too much to do to deal with it. But would definitely be nice to get this figured out. It's like something in the UI's apply config gets brought back from the dead after the upgrade but doesn't exist anymore and it just thinks it does :/
You do not have the required permissions to view the files attached to this post.
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Re: Configuration error after upgrade to 2.7

Post by mp4783 »

My theory, and this is just a guess, is that you've got a host entry in the MySQL database that doesn't belong there. I say this because Nagios XI is primary a GUI front end over Nagios core. This is implemented through the addition of PostgreSQL and MySQL backend databases. The GUI makes it so much easier to manage the configuration in a addition to providing additional tools.

I have actually seen errors just like this before, but my memory is awful and I can't tell you the precise circumstances. However, whenever you encounter something where the GUI isn't working, but command line is, I check the backend databases.

You might also try running the following:

Code: Select all

cd /usr/local/nagios/nagiosxi/scripts
./nagiosql_delete_host.php --host=KSKE4165387
If this has no effect, then search the MySQL nagiosql database for the host. If you find it, you may have to perform "surgery" to remove it, which can be very tricky.
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Configuration error after upgrade to 2.7

Post by JakeHatMacys »

mp4783 wrote:My theory, and this is just a guess, is that you've got a host entry in the MySQL database that doesn't belong there. I say this because Nagios XI is primary a GUI front end over Nagios core. This is implemented through the addition of PostgreSQL and MySQL backend databases. The GUI makes it so much easier to manage the configuration in a addition to providing additional tools.

I have actually seen errors just like this before, but my memory is awful and I can't tell you the precise circumstances. However, whenever you encounter something where the GUI isn't working, but command line is, I check the backend databases.

You might also try running the following:

Code: Select all

cd /usr/local/nagios/nagiosxi/scripts
./nagiosql_delete_host.php --host=KSKE4165387
If this has no effect, then search the MySQL nagiosql database for the host. If you find it, you may have to perform "surgery" to remove it, which can be very tricky.
Yeah didn't find it, I ran the script from

/usr/local/nagiosxi/scripts as there wasn't a Nagiosxi folder in the nagios sub. Guessin that was a typo:

[root@esu2v239 scripts]# ./nagiosql_delete_host.php --host=KSKE4165387
URL: http://localhost/nagiosxi/includes/components/ccm/
Unable find host in nagiosql database
[root@esu2v239 scripts]#
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Configuration error after upgrade to 2.7

Post by lmiltchev »

JakeHatMacys, "reconfigure.sh" runs fine for you as root. Can you try running it as a nagios user?

Code: Select all

su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Do you get any errors?
Be sure to check out our Knowledgebase for helpful articles and solutions!
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Configuration error after upgrade to 2.7

Post by JakeHatMacys »

lmiltchev wrote:JakeHatMacys, "reconfigure.sh" runs fine for you as root. Can you try running it as a nagios user?

Code: Select all

su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Do you get any errors?
Not yet, asking for a a PW when running as "nagios" Is there a standard default? I don't recall ever changing anything regarding it.

Code: Select all

 Checked 3127 hosts.
        Checked 783 host groups.
        Checked 2 service groups.
        Checked 9 contacts.
        Checked 2 contact groups.
        Checked 123 commands.
        Checked 16 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 3127 hosts
        Checked 0 service dependencies
        Checked 2328 host dependencies
        Checked 16 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 12567
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
Locked