Page 1 of 1

NagiosQL hosts not showing in Nagios Core

Posted: Thu Dec 05, 2013 6:30 am
by Ingmar79
Yello!

I am running Nagios Core 3.5.0 with NagiosQL 3.2.0 on a CentOS VM. I am running NSclient++ 4.1.102 on the windows VM's.

I started with two hosts and a few services. Those run perfectly and no errors are shown. Host files are in the etc/nagiosql/hosts folder. But
when I try to add more hosts in NagiosQL, those hosts never show up in Nagios Core. It keeps on showing the two original hosts.

I've checked the support link in NagiosQL, which is showing me the correct number of hosts. So I know it's reading the /etc/nagiosql/hosts folder correctly. I have also checked the nagios.cfg file by running it (../nagios -v ../nagios.cfg). No errors come up anywhere. The hosts in NagiosQL are set to active and all parameters are the
same as on the original hosts.

I just can't figure out why NagiosQL can read the host files, nagios.cfg is running without a problem, but nagios core services fail to show me those new hosts.

Any ideas/tips for me perhaps?

Thanks in advance, Ingmar

Re: NagiosQL hosts not showing in Nagios Core

Posted: Thu Dec 05, 2013 11:16 am
by abrist
When you run the config verification, is the number of services/hosts reported correct?

Re: NagiosQL hosts not showing in Nagios Core

Posted: Fri Dec 06, 2013 4:21 am
by Ingmar79
Yes. When I run the NagiosQL configuration check (step 3), it shows the right amount of hosts. Everything seems fine. Until I check the Nagios monitoring window and I only see the two original hosts. No other host is being monitored according to Nagios itself.

I also checked in commandline if I could find any other host configuration files across the filesystem, indicating nagios is reading from another location then NagiosQL saves the host config files, but there aren't any. The two hosts that are being shown are in the /etc/nagiosql/hosts folder. Permissions on those files are the same for all files in that folder.

Re: NagiosQL hosts not showing in Nagios Core

Posted: Fri Dec 06, 2013 12:02 pm
by slansing
Please share the output from:

Code: Select all

cat /usr/local/nagios/etc/nagios.cfg | grep cfg_file
Note: if your nagios.cfg is in a different location "due to a non centos/rhel install" just change the directory above.

Re: NagiosQL hosts not showing in Nagios Core

Posted: Sat Dec 07, 2013 6:14 am
by Ingmar79
I grabbed both the dir and file locations. The hosts are in /etc/nagiosql/hosts/

If I create a new host, it will place it there too. Sorry btw if I post a bit slowly, I was on a trip to England.

cat /usr/local/nagios/etc/nagios.cfg | grep cfg_file

#cfg_file=/usr/local/nagios/etc/objects/commands.cfg
#cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
#cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
#cfg_file=/usr/local/nagios/etc/objects/templates.cfg
cfg_file=/etc/nagiosql/contacttemplates.cfg
cfg_file=/etc/nagiosql/contactgroups.cfg
cfg_file=/etc/nagiosql/contacts.cfg
cfg_file=/etc/nagiosql/timeperiods.cfg
cfg_file=/etc/nagiosql/commands.cfg
cfg_file=/etc/nagiosql/hostgroups.cfg
#cfg_file=/etc/nagiosql/servicegroups.cfg
cfg_file=/etc/nagiosql/hosttemplates.cfg
cfg_file=/etc/nagiosql/servicetemplates.cfg
#cfg_file=/etc/nagiosql/servicedependencies.cfg
#cfg_file=/etc/nagiosql/serviceescalations.cfg
#cfg_file=/etc/nagiosql/hostdepenencies.cfg
#cfg_file=/etc/nagiosql/hostescalations.cfg
#cfg_file=/etc/nagiosql/hostextinfo.cfg
#cfg_file=/etc/nagiosql/serviceextinfo.cfg
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
# object configuration files (see the cfg_file and cfg_dir options above).

cat /usr/local/nagios/etc/nagios.cfg | grep cfg_dir

# extension) in a particular directory by using the cfg_dir
#cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers
cfg_dir=/etc/nagiosql/hosts
cfg_dir=/etc/nagiosql/services
# object configuration files (see the cfg_file and cfg_dir options above).

Re: NagiosQL hosts not showing in Nagios Core

Posted: Mon Dec 09, 2013 11:49 am
by sreinhardt
No worries on the delay, hopefully it was a good trip! What are the permissions on /etc/nagiosql/hosts/ and files below? Just want to be sure they are readable by nagios user or group and not just by apache.

Re: NagiosQL hosts not showing in Nagios Core

Posted: Mon Dec 09, 2013 11:50 am
by abrist
Lets verify that you do not have multiple nagios.cfg files on the system:

Code: Select all

yum install mlocate
updatedb
locate nagios.cfg

Re: NagiosQL hosts not showing in Nagios Core

Posted: Mon Dec 09, 2013 12:24 pm
by Ingmar79
Hello guys,

Yes had a wonderful trip. Bit short, because it was a business trip. But English people never fail te amaze me :)

I already found the problem, when looking at the nagios event log itself. I had a server with an ns++ client error, that somehow blocked nagios from getting the other hosts info. After I re-installed the ns++ client and set it up correctly, the other hosts appeared and all was well again. I should've checked the event log sooner, but thought it was a permission problem as well.

Thanks for all your help here and your support!

Ingmar

Re: NagiosQL hosts not showing in Nagios Core

Posted: Mon Dec 09, 2013 12:29 pm
by abrist
Glad it is resolved. Have a great week!