[Nagiosplug-devel] [ nagiosplug-Bugs-719783 ] check_procs -a strstr result test wrong?
SourceForge.net
noreply at sourceforge.net
Fri Apr 11 17:03:27 CEST 2003
Bugs item #719783, was opened at 2003-04-11 17:32
Message generated for change (Comment added) made by tonvoon
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=719783&group_id=29880
Category: Argument proccessing
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Laurent Vaslin (laurentv)
>Assigned to: Ton Voon (tonvoon)
Summary: check_procs -a strstr result test wrong?
Initial Comment:
Hi,
I'm using nagios-plugins-1.3.0 (stable release) on a
solaris 8 sparc machine
I'm monitoring perl processes running as show with
command:
ps -Ao 's uid ppid comm args' |grep perl
S 0 1 /usr/bin/perl
/usr/bin/perl /usr/local/script/test.pl
S 0 1 /usr/bin/perl
/usr/bin/perl /usr/local/script/prod.pl
The command :
check_procs -w 1: -c 1: -a /usr/local/script/prod.pl
return
CRITICAL - 0 processes running with
args /usr/local/script/prod.pl
My investigations leads me to the following file
nagios-plugins-1.3.0/plugins/check_progs.c
Ligne 138 (strstr (procargs, args) == procargs))
Shoudn't it be
(strstr (procargs, args) != NULL))
then check_procs -w 1: -c 1: -a /usr/local/script/prod.pl
return
OK - 2 processes running with
args /usr/local/script/prod.pl
and
check_procs -w 1: -c 1: -C /usr/bin/perl -
a /usr/local/script/prod.pl
return OK - 1 processes running with command
name /usr/bin/perl, args /usr/local/script/prod.pl
Am I correct ?
Tks
Laurent
----------------------------------------------------------------------
>Comment By: Ton Voon (tonvoon)
Date: 2003-04-12 01:18
Message:
Logged In: YES
user_id=664364
Laurent,
Thanks for the report. If you run:
./check_procs -a "/usr/bin/perl /usr/local/script/prod.pl"
this should catch the process you expect.
I take your point about the pattern matching. If you run:
./check_procs -a /usr/bin/perl
this will pick up the 2 processes two even though it is not a full match.
Based on this, I'll make the changes you wish and clarify the help. One other addition: ignore any processes with command=check_procs, otherwise will never get 0 processes as the check_procs call itself will always match the partial -a in its own argument list.
Changes made to HEAD and r1_3_0 and closing this call.
Ton
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=719783&group_id=29880
More information about the Devel
mailing list