Wrong count of nrpe processes with check_procs
Posted: Mon Apr 01, 2019 9:53 am
Hi,
I got strange behavior with check_procs plugin trying to monitor a total count of nrpe processes on host. Running from shell it displays correct value:
# systemctl status nrpe
● nrpe.service - NRPE
Loaded: loaded (/etc/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2017-03-27 13:07:14 UTC; 2 years 0 months ago
Main PID: 23533 (nrpe)
CGroup: /system.slice/nrpe.service
└─23533 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
# /usr/lib64/nagios/plugins/check_procs -m PROCS -w 1:1 -c 1:1 -C nrpe
PROCS OK: 1 process with command name 'nrpe' | procs=1;1:1;1:1;0;
# sudo -u nagios /usr/lib64/nagios/plugins/check_procs -m PROCS -w 1:1 -c 1:1 -C nrpe
PROCS OK: 1 process with command name 'nrpe' | procs=1;1:1;1:1;0;
# nrpe
NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
Last Modified: 09-06-2013
But when this check is executed from server - I get 2 as the result for counting of nrpe processes. This happens only for nrpe process. Counting for other processes like nginx works fine.
Command definition:
object CheckCommand "count-nrpe-processes" {
command = [ PluginDir + "/check_nrpe" ]
arguments = {
"-H" = {
value = "$host.vars.address$"
}
"-c" = {
value = "check_procs"
}
"-a" = {
value = "PROCS!1:1!1:1!nrpe"
}
}
}
I got strange behavior with check_procs plugin trying to monitor a total count of nrpe processes on host. Running from shell it displays correct value:
# systemctl status nrpe
● nrpe.service - NRPE
Loaded: loaded (/etc/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2017-03-27 13:07:14 UTC; 2 years 0 months ago
Main PID: 23533 (nrpe)
CGroup: /system.slice/nrpe.service
└─23533 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
# /usr/lib64/nagios/plugins/check_procs -m PROCS -w 1:1 -c 1:1 -C nrpe
PROCS OK: 1 process with command name 'nrpe' | procs=1;1:1;1:1;0;
# sudo -u nagios /usr/lib64/nagios/plugins/check_procs -m PROCS -w 1:1 -c 1:1 -C nrpe
PROCS OK: 1 process with command name 'nrpe' | procs=1;1:1;1:1;0;
# nrpe
NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
Last Modified: 09-06-2013
But when this check is executed from server - I get 2 as the result for counting of nrpe processes. This happens only for nrpe process. Counting for other processes like nginx works fine.
Command definition:
object CheckCommand "count-nrpe-processes" {
command = [ PluginDir + "/check_nrpe" ]
arguments = {
"-H" = {
value = "$host.vars.address$"
}
"-c" = {
value = "check_procs"
}
"-a" = {
value = "PROCS!1:1!1:1!nrpe"
}
}
}