check_nrpe calling nsclient unknown status

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
staylor8
Posts: 1
Joined: Thu Mar 28, 2019 3:06 pm

check_nrpe calling nsclient unknown status

Post by staylor8 »

I am using

Code: Select all

Nagios Core Version 4.2.0
NSClient++ 0.4.3.143 2015-04-29 x64
When I launch NSclient in Test mode this command works fine.

Code: Select all

check_service "filter=name='OpenVPNService'" "empty-state=critical"
If I manually run this from nagios:

Code: Select all

./libexec/check_nrpe -H server.domain.com -c check_service -a "filter=name='OpenVPNService'" "empty-state=critical"
I get this back:

Code: Select all

OK: All 1 service(s) are ok.
When I use my service definition:

Code: Select all

define service {
        use                     generic-service
        host_name               server
        service_description     OpenVPN Tunnel Status
        check_command           check_nrpe!server.domain.com!check_service -a "filter=name'OpenVPNService'" "empty-state=critical"
}
I only get a status of UNKNOWN in the web UI

What am I missing?

Thanks,

Shawn
User avatar
swolf
Developer
Posts: 294
Joined: Tue Jun 06, 2017 9:48 am

Re: check_nrpe calling nsclient unknown status

Post by swolf »

Hi @staylor8,

I don't have a Nagios Core instance open right now, but on my Nagios XI machine check_nrpe is defined as follows:

Code: Select all

define command {
    command_name    check_nrpe
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
As far as I remember this is the same as in Nagios Core, but you may want to verify.

If this is true, then your current service will be executing a command line like

Code: Select all

./libexec/check_nrpe -H server.domain.com -t 30 -c server.domain.com check_service -a "filter=name'OpenVPNService'" "empty-state=critical"
$HOSTADDRESS$ will be taken off of the config for 'server', so you should be able to change your service config to the following:

Code: Select all

define service {
        use                     generic-service
        host_name               server
        service_description     OpenVPN Tunnel Status
        check_command           check_nrpe!check_service -a "filter=name'OpenVPNService'" "empty-state=critical"
}
Let me know if that works for you!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Locked