Page 1 of 1

After import, Core sees hosts and services but XI does not

Posted: Wed May 15, 2019 4:58 pm
by eloyd
I'm scratching my head over this one and I hope there's an easy (and fast!) answer.

We're locked into using XI 5.5.2 for this particular customer, and we built some configuration in Core for them. Then they decided they wanted them in XI. So we reconfigured everything to be import-friendly for XI (drop one file into ../etc/import and off you go). The import works great. The Nagios Core engine sees the 16 new hosts and 2000 new services. They're in CCM. But Nagios XI doesn't show them at all on its screens, nor does it think there's any hosts other than localhost and default services:

Nagiostsats output:

Code: Select all

Nagios Stats 4.4.1
Copyright (c) 2003-2008 Ethan Galstad (www.nagios.org)
Last Modified: 2018-06-25
License: GPL

CURRENT STATUS DATA
------------------------------------------------------
Status File:                            /usr/local/nagios/var/status.dat
Status File Age:                        0d 0h 0m 2s
Status File Version:                    4.4.1

Program Running Time:                   0d 0h 1m 3s
Nagios PID:                             17623

Total Services:                         1996
Services Checked:                       1612
Services Scheduled:                     1996
Services Actively Checked:              1996
Services Passively Checked:             0
[snip]
Services Ok/Warn/Unk/Crit:              1664 / 0 / 248 / 84
Services Flapping:                      0
Services In Downtime:                   0

Total Hosts:                            17
Hosts Checked:                          1
Hosts Scheduled:                        17
Hosts Actively Checked:                 17
Host Passively Checked:                 0
[snip]
Hosts Up/Down/Unreach:                  17 / 0 / 0
Hosts Flapping:                         0
Hosts In Downtime:                      0
Nagios XI CCM screen shot (and yes, they're all "Active"):
Capture.PNG
And yet, Nagios XI sees nothing:

Code: Select all

# echo 'select count(*) from nagios.nagios_hosts;' | mysql -s -pnagiosxi
1
# echo 'select count(*) from nagios.nagios_services;' | mysql -s -pnagiosxi
12
And:
Capture2.PNG
Help! No amount of restarting, repairing databases, reconfiguring, etc seems to work. What obvious step did we miss during the import, or how can we get XI to actually see the hosts/services that Core is obviously seeing?

Re: After import, Core sees hosts and services but XI does n

Posted: Thu May 16, 2019 9:02 am
by tgriep
It sure sounds like the ndo2db daemon that writes the running data to the nagios database is not running or starting.

Try this to to reset it and see if it starts up.

Code: Select all

service ndo2db stop
rm -f /usr/local/nagios/var/ndo.sock
rm -f /usr/local/nagios/var/ndo2db.lock
service ndo2db start
Give the system a few minutes to run and check the GUI to see if the data is updating.

If not, check the /var/log/messages file for any errors writing to the database as well as any errors in the MYSQL log.

Another place to look is in the Apache error logs in the /var/log/httpd folder.
Look for any MYSQL connection messages.

Let us know what you find in the logs.

Re: After import, Core sees hosts and services but XI does n

Posted: Thu May 16, 2019 2:19 pm
by eloyd
ndo2db was the problem. We figured that out later but couldn't get it fixed. Nor did we try the steps in your response since I didn't see this until now. :-)

Since this was on a VM that we used to set up a proving ground for the actual customer (which is inside a secure, no-Internet facility) we just "crossed our fingers" that it would work. Today, 90 minutes ago, it did. :-)

Re: After import, Core sees hosts and services but XI does n

Posted: Thu May 16, 2019 3:19 pm
by tgriep
Day late and a Dollar short......

Just curious, what did you do to ndo2db?

Re: After import, Core sees hosts and services but XI does n

Posted: Thu May 16, 2019 3:23 pm
by eloyd
Nothing. We installed a new CentOS VM, installed 5.5.2 (required version) and did a bunch of config file and plugin development work. Then we massaged things to an import file that could be copied to the client's box and tested by importing on a new, empty XI 5.5.2 VM. It was that second box that had the problems. We finally gave up trying to fix it and just "went for it" and it worked. So we deleted the VM and never actually solved the problem.

Re: After import, Core sees hosts and services but XI does n

Posted: Thu May 16, 2019 3:59 pm
by tgriep
Ah, OK.