summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 44248b8)
raw | patch | inline | side by side (parent: 44248b8)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 20 Sep 2005 11:34:34 +0000 (11:34 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 20 Sep 2005 11:34:34 +0000 (11:34 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1231 f882894a-f735-0410-b71e-b25c423dba1c
configure.in | patch | blob | history | |
plugins/t/check_procs.t | patch | blob | history |
diff --git a/configure.in b/configure.in
index 76ad0130aa67981fcd5106e141cb59aa3726f101..6b812c6f5a22068267112c172dcc078ad6338836 100644 (file)
--- a/configure.in
+++ b/configure.in
ac_cv_ps_cols=9
AC_MSG_RESULT([$ac_cv_ps_command])
-dnl Tru64 - needs %*[ +] in PS_FORMAT
-elif ps -ao 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
- egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
-then
- ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
- ac_cv_ps_command="$PATH_TO_PS -ao 'stat uid pid ppid vsz rss pcpu comm args'"
- ac_cv_ps_format=["%s%*[ +] %d %d %d %d %d %f %s %n"]
- ac_cv_ps_cols=9
+dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
+dnl Has /usr/bin/ps and /sbin/ps - force sbin version
+dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
+dnl of 1500). Will need big changes to check_procs to support
+elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
+ egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
+ ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
+ ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
+ ac_cv_ps_cols=8
AC_MSG_RESULT([$ac_cv_ps_command])
elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
index cb5f1224be30a316284b9fb19ec99b15a2d1749f..91f5c44d6d09a57ff4656b5731767bfd76bbfc87 100644 (file)
--- a/plugins/t/check_procs.t
+++ b/plugins/t/check_procs.t
use NPTest;
use vars qw($tests);
-BEGIN {$tests = 10; plan tests => $tests}
+BEGIN {$tests = 12; plan tests => $tests}
my $t;
$t += checkCmd( "./check_procs -w 0 -c 10000000", 1, '/^PROCS WARNING: [0-9]+ process(es)?$/' );
$t += checkCmd( "./check_procs -w 0 -c 0", 2, '/^PROCS CRITICAL: [0-9]+ process(es)?$/' );
$t += checkCmd( "./check_procs -w 0 -c 0 -s S", 2, '/^PROCS CRITICAL: [0-9]+ process(es)? with /' );
+$t += checkCmd( "./check_procs -w 0 -c 10000000 -p 1", 1, "/^PROCS WARNING: [0-9]+ process(es)? with PPID = 1/' );
exit(0) if defined($Test::Harness::VERSION);
exit($tests - $t);