check_nrpe -c check_procs Not Working
Posted: Mon Aug 17, 2020 1:46 pm
I've read through at least ten different threads, and I cannot get this to work.
In the UI, the check is configured as such:
$USER1$/check_nrpe -2 -H $HOSTADDRESS$ -t 30 -c $ARG1$
ARG1 = check_procs -a '-c 1:1024 -Csshd'
This was working for a couple of years; I have no idea when it stopped working, but I discovered it today when trying to add a check for ns-slapd. It doesn't matter what process I choose, sshd, httpd, ntpd, etc., they all fail.
When I run the command from the UI, it returns nothing (just the full command, no error or anything). When I run it from the CLI, I get this:
These are all the combinations I tried:
In the client's /etc/nagios/nrpe.cfg, I have this:
If I change the client's nrpe.cfg file to this:
The command works.
Why?
In the UI, the check is configured as such:
$USER1$/check_nrpe -2 -H $HOSTADDRESS$ -t 30 -c $ARG1$
ARG1 = check_procs -a '-c 1:1024 -Csshd'
This was working for a couple of years; I have no idea when it stopped working, but I discovered it today when trying to add a check for ns-slapd. It doesn't matter what process I choose, sshd, httpd, ntpd, etc., they all fail.
When I run the command from the UI, it returns nothing (just the full command, no error or anything). When I run it from the CLI, I get this:
Code: Select all
# /usr/local/nagios/libexec/check_nrpe -H <TARGET HOST> -t 30 -c check_procs -a "'-C sshd' '-c 1:'"
Usage:
check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-k] [-t timeout] [-v]Code: Select all
# /usr/local/nagios/libexec/check_nrpe -H <TARGET_HOST> -c check_procs -a "'sshd' '1:'"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
# /usr/local/nagios/libexec/check_nrpe -H <TARGET_HOST> -c check_procs -a '"sshd" "1:"'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
# /usr/local/nagios/libexec/check_nrpe -H <TARGET_HOST> -c check_procs -a '"-C sshd" "-c 1:"'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
# /usr/local/nagios/libexec/check_nrpe -H <TARGET_HOST> -c check_procs -a '"-C sshd" "-c 1:'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
# /usr/local/nagios/libexec/check_nrpe -H <TARGET_HOST> -c check_procs -a "'-C sshd' '-c 1:'"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
# /usr/local/nagios/libexec/check_nrpe -H <TARGET_HOST> -c check_procs -a ''-C sshd' '-c 1:''
Usage:
check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-k] [-t timeout] [-v]
Code: Select all
command[check_procs]=/usr/lib64/nagios/plugins/check_procs -C $ARG1$ -c $ARG2$Code: Select all
command[check_procs]=/usr/lib64/nagios/plugins/check_procs -C $ARG1$Code: Select all
# /usr/local/nagios/libexec/check_nrpe -H <TARGET HOST> -c check_procs -a "sshd"
PROCS OK: 3 processes with command name 'sshd' | procs=3;;;0;Why?