Page 1 of 1

check_procs problem /bug?

Posted: Fri May 22, 2020 3:15 pm
by myootnt
Hello,
I'm having an issue where check_procs doesn't pick up an unusual process name. Is there a workaround or is this a true bug?
This is happening with plugin v1.5, 2.2.1 and v2.3.3 on CentOS 8.1
Here's the process name, the failing check command and successful check of another process on the same host:
Process:
# ps -ef | grep smokeping
root 2099 1 0 May04 ? 00:01:37 /usr/local/smokeping/bin/smokeping [FPing]
Failed check:
# /usr/local/nagios-plugins-2.3.3/libexec/check_procs -C smokeping
PROCS OK: 0 processes with command name 'smokeping' | procs=0;;;0;
Successful check of another proc:
# /usr/local/nagios-plugins-2.3.3/libexec/check_procs -C smsd
PROCS OK: 2 processes with command name 'smsd' | procs=2;;;0;

Thanks for any positive input on this.

Re: check_procs problem /bug?

Posted: Fri May 22, 2020 4:13 pm
by jdunitz
Hi Myootnt!

Code: Select all

[root@jpd-nagiosxi-one etc]# ps waux | grep smokepi
root     63575  0.0  1.4 318452 27804 ?        Ss   15:50   0:00 /opt/smokeping-2.7.3/bin/smokeping [FPing]
root     63774  0.0  0.0 112712   968 pts/1    S+   15:51   0:00 grep --color=auto smokepi
I see what you mean...

Code: Select all

[root@jpd-nagiosxi-one etc]# /usr/local/nagios/libexec/check_procs -C smokeping
PROCS OK: 0 processes with command name 'smokeping' | procs=0;;;0;


Nope.

How about...

Code: Select all

 [root@jpd-nagiosxi-one etc]# /usr/local/nagios/libexec/check_procs -C "smokeping [FPing]"
PROCS OK: 0 processes with command name 'smokeping [FPing]' | procs=0;;;0;
[root@jpd-nagiosxi-one etc]# /usr/local/nagios/libexec/check_procs -C FPing
PROCS OK: 0 processes with command name 'FPing' | procs=0;;;0;
[root@jpd-nagiosxi-one etc]# 
Still nope.

Maybe a regex?

Code: Select all

[root@jpd-nagiosxi-one etc]# /usr/local/nagios/libexec/check_procs   --ereg-argument-array='.*smoke.*'
PROCS OK: 1 process with regex args '.*smoke.*' | procs=1;;;0;
Aha!
Give that a try!

Re: check_procs problem /bug?

Posted: Fri May 22, 2020 4:23 pm
by myootnt
Thanks! My own attempt at something similar had failed.

Re: check_procs problem /bug?

Posted: Tue May 26, 2020 10:49 am
by benjaminsmith
HI
Thanks! My own attempt at something similar had failed.
No problem, it sounds like you got it working. Shall we close out this thread?

Re: check_procs problem /bug?

Posted: Tue May 26, 2020 1:47 pm
by myootnt
Go head and close it. Thanks again.

Re: check_procs problem /bug?

Posted: Tue May 26, 2020 2:52 pm
by benjaminsmith
Go head and close it. Thanks again.
Excellent! Thanks for visiting the Nagios Community Forum.