Nagios core not looking for client hosts

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dlanced
Posts: 3
Joined: Thu Dec 07, 2017 11:27 am

Nagios core not looking for client hosts

Post by dlanced »

Hi,
I've got Nagios Core going on Ubuntu 16.04, but it's not identifying a client host (also running Ubuntu 16.04).

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.1.23
works fine, the

Code: Select all

cfg_dir=/usr/local/nagios/etc/servers
line in nagios.cfg is uncommented, and

Code: Select all

/usr/local/nagios/etc/servers/nagios-client6
exists with this configuration:

Code: Select all

define host {
        use                             linux-server
        host_name                       nagios-client6
        alias                           Client6
        address                         192.168.1.23
        max_check_attempts              5
        check_period                    24x7
        notification_interval           30
        notification_period             24x7
}
define service {
        use                             generic-service
        host_name                       nagios-client6
        service_description             CPU load
        check_command                   check_nrpe!check_load
}
define service {
        use                             generic-service
        host_name                       nagios-client6
        service_description             /dev/sda2 free space
        check_command                   check_nrpe!check_sda2
}
The allowed_hosts line in nrpe.cfg on the host reads:

Code: Select all

allowed_hosts=127.0.0.1,::1,192.168.1.22
...but that's obviously working since check_nrpe was successful.
Now here's the strange thing: there is no reference to my client of any kind in /usr/local/nagios/var/status.dat, just a hoststatus {} section for localhost, but none - or any servicestatus {} sections - for the client.
I'm not seeing any reference to failures in the logs - or any reference to nrpe at all, for that matter.

I used a bit of a blend of guides for building the Nagios server, here are the packages I installed for on the Nagios server machine for nrpe:

Code: Select all

apt install build-essential libgd2-xpm-dev openssl libssl-dev autoconf gcc libc6 libmcrypt-dev make
And here's the output of /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Code: Select all

Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL

Website: https://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 8 services.
	Checked 1 hosts.
	Checked 1 host groups.
	Checked 0 service groups.
	Checked 1 contacts.
	Checked 1 contact groups.
	Checked 25 commands.
	Checked 5 time periods.
	Checked 0 host escalations.
	Checked 0 service escalations.
Checking for circular paths...
	Checked 1 hosts
	Checked 0 service dependencies
	Checked 0 host dependencies
	Checked 5 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
Any ideas about what I'm doing wrong?
Thanks!
kyang

Re: Nagios core not looking for client hosts

Post by kyang »

Just to be sure, does nagios-client6 have a .cfg extension?

Code: Select all

# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
To add a cfg_dir the config files in that directory must have .cfg

Then do a nagios restart.

Code: Select all

sudo systemctl restart nagios.service
Let us know if this helps!
dlanced
Posts: 3
Joined: Thu Dec 07, 2017 11:27 am

Re: Nagios core not looking for client hosts

Post by dlanced »

kyang wrote:Just to be sure, does nagios-client6 has a .cfg extension?

Code: Select all

# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
To add a cfg_dir the config files in that directory must have .cfg

Then do a nagios restart.

Code: Select all

sudo systemctl restart nagios.service
Let us know if this helps!
How did you know that? Of course leaving off the .cfg is the dumb mistake I made! :D
Thanks so much!
kyang

Re: Nagios core not looking for client hosts

Post by kyang »

Sounds good!

Did this solve your issue? Are we okay to close this thread?
dlanced
Posts: 3
Joined: Thu Dec 07, 2017 11:27 am

Re: Nagios core not looking for client hosts

Post by dlanced »

Absolutely. I'm up and running.
Thanks.
kyang

Re: Nagios core not looking for client hosts

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked