NSClient++ NRPE check_uptime with arguments fails
Posted: Thu Feb 07, 2019 11:24 am
Nagios Core 4.3.2 on RHEL 7.4 monitoring Windows 2008R2 running NSClient++ 0.5.2.35
When I try to configure a command/service using check_uptime with arguments, it errors in Nagios as "Unknown command(s): check_uptime -a 'warn= uptime > 27d'" and using nscp test on the target server while it does this I can see "E core Unknown command(s): check_uptime -a 'warn= > 27d' available commands: commands {, check_counter, check_cpu, check_memory, check_network, check_os_version, check_pagefile, check_pdh, check_process, check_service, check_uptime, checkcounter, checkcpu, checkmem, checkprocstate, checkservicestate, check_uptime}, plugins {, 0} c:\source\master\service\plugin_manager.cpp:475"
This is with the following command and service defined:
In nscp I have activated the CheckSystem module and in nsclient.ini I have allowed arguments and nasty characters under /settings/NRPE/server (it did complain about these until I enabled them but now I just get the "Unknown command" error in the Nagios CGI and nscp test output.
If I amend the command to remove everything after "check_uptime" it works (but obviously without the thresholds I want).
If I run the following command from the Nagios server it returns successfully:
I have tried changing the single quotes and double quotes around in the command definition and also removing the -a to no avail.
When I try to configure a command/service using check_uptime with arguments, it errors in Nagios as "Unknown command(s): check_uptime -a 'warn= uptime > 27d'" and using nscp test on the target server while it does this I can see "E core Unknown command(s): check_uptime -a 'warn= > 27d' available commands: commands {, check_counter, check_cpu, check_memory, check_network, check_os_version, check_pagefile, check_pdh, check_process, check_service, check_uptime, checkcounter, checkcpu, checkmem, checkprocstate, checkservicestate, check_uptime}, plugins {, 0} c:\source\master\service\plugin_manager.cpp:475"
This is with the following command and service defined:
Code: Select all
define command{
command_name check_nrpe_uptime
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c "check_uptime -a 'warn= uptime > 27d'"
}
Code: Select all
define service{
service_description Uptime
host_name server01
check_command check_nrpe_uptime
use generic-service
}
If I amend the command to remove everything after "check_uptime" it works (but obviously without the thresholds I want).
If I run the following command from the Nagios server it returns successfully:
Code: Select all
[root@nagios01 nagios]# /usr/lib64/nagios/plugins/check_nrpe -H server -c check_uptime -a "warn=uptime > 27d"
OK: uptime: 1d 06:5h, boot: 2019-02-06 10:12:17 (UTC)|'uptime'=108347s;2332800;86400