Page 1 of 2

Configuration error after upgrade to 2.7

Posted: Fri Apr 24, 2015 1:55 pm
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.

Re: Configuration error after upgrade to 2.7

Posted: Fri Apr 24, 2015 2:11 pm
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

Re: Configuration error after upgrade to 2.7

Posted: Fri Apr 24, 2015 2:18 pm
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

Re: Configuration error after upgrade to 2.7

Posted: Fri Apr 24, 2015 2:48 pm
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.

Re: Configuration error after upgrade to 2.7

Posted: Fri Apr 24, 2015 5:49 pm
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

Re: Configuration error after upgrade to 2.7

Posted: Mon Apr 27, 2015 7:13 am
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 :/

Re: Configuration error after upgrade to 2.7

Posted: Mon Apr 27, 2015 8:18 am
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.

Re: Configuration error after upgrade to 2.7

Posted: Mon Apr 27, 2015 8:35 am
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]#

Re: Configuration error after upgrade to 2.7

Posted: Mon Apr 27, 2015 10:49 am
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?

Re: Configuration error after upgrade to 2.7

Posted: Mon Apr 27, 2015 12:07 pm
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: