diff options
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-03-11 18:32:08 +0000 |
---|---|---|
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-03-11 18:32:08 +0000 |
commit | aad5b084913ee29cdda1849a11cd10090274b824 (patch) | |
tree | 9b8dbe4b968a1c5228a040a35a77f579f71c7aaf | |
parent | 261b267e0965febb4f41237d79d7cb580a4fc029 (diff) | |
download | monitoring-plugins-aad5b084913ee29cdda1849a11cd10090274b824.tar.gz |
Minor change to Karl's statfs check
Inclusion of ICMPv6 ping tests to define PING6_COMMAND
Minor fix to ps syntax checking to fix bug I introduced last nite
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@394 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | configure.in | 221 |
1 files changed, 182 insertions, 39 deletions
diff --git a/configure.in b/configure.in index 1cad0d95..179fd259 100644 --- a/configure.in +++ b/configure.in @@ -42,8 +42,10 @@ choke -- this is a workaround for a Sun-specific problem #include <sys/types.h> #include <sys/vfs.h>], [struct statfs t; long c = *(t.f_spare);], -fu_cv_sys_truncating_statfs=yes, -fu_cv_sys_truncating_statfs=no, +fu_cv_sys_truncating_statfs=yes +AC_MSG_RESULT(yes), +fu_cv_sys_truncating_statfs=no +AC_MSG_RESULT(no), )]) if test $fu_cv_sys_truncating_statfs = yes; then AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1, @@ -596,8 +598,7 @@ ac_cv_use_ps_vars=no AC_MSG_CHECKING(for ps syntax) dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND if ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \ - egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ \ - +P[PID]+ +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -629,8 +630,7 @@ then dnl BSD-like mode in RH 6.1 elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \ - egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] \ - >/dev/null + egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -646,9 +646,8 @@ then dnl SunOS 4.1.3: dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND -elif ps -laxnwww 2>/dev/null | egrep -i ["^ *F(LAGS)? +UID +PID +PPID \ - +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME \ - +COMMAND"] >/dev/null +elif ps -laxnwww 2>/dev/null | \ + egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_raw_command="$PATH_TO_PS laxnwww" @@ -666,8 +665,8 @@ dnl Debian Linux / procps v1.2.9: dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2] dnl -elif ps laxnwww 2>/dev/null | egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI \ - +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null +elif ps laxnwww 2>/dev/null | \ + egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_raw_command="$PATH_TO_PS laxnwww" @@ -683,8 +682,7 @@ then dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs) elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \ - egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ \ - +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -700,8 +698,7 @@ then dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \ - egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ \ - +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -716,8 +713,7 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \ - egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ \ - +P[PID]+ +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -732,8 +728,7 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \ - egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ - +PPID +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -748,8 +743,7 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \ - egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ - +PPID +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -764,8 +758,7 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \ - egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ - +PPID +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -781,8 +774,7 @@ then dnl wonder who takes state instead of stat elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \ - egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ - +PPID +[RGSCOMDNA]+"] >/dev/null + egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,procprog,&pos]" @@ -797,8 +789,8 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) dnl IRIX 53 -elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \ - +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null +elif ps -el 2>/dev/null | \ + egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]" @@ -811,8 +803,8 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) dnl IRIX 63 -elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \ - +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null +elif ps -el 2>/dev/null | \ + egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]" @@ -827,8 +819,8 @@ then dnl AIX 4.1: dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper -elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \ - +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null +elif ps -el 2>/dev/null | \ + egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]" @@ -841,8 +833,8 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) dnl AIX? -elif ps glaxen 2>/dev/null | egrep -i ["^ *F +UID +PID +PPID +PRI +NI \ - +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null +elif ps glaxen 2>/dev/null | \ + egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[&procuid,&procppid,procstat,&pos,procprog]" @@ -874,8 +866,8 @@ then AC_MSG_RESULT([$ac_cv_ps_command]) dnl UnixWare -elif ps -Al 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI \ - +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null +elif ps -Al 2>/dev/null | \ + egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null then ac_cv_use_ps_vars=yes ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]" @@ -961,11 +953,12 @@ AC_ARG_WITH(ping_command, [sets syntax for ICMP ping]), ac_cv_ping_command=$withval,) -AC_MSG_CHECKING(for ping syntax) +AC_MSG_CHECKING(for ICMP ping syntax) +ac_cv_ping_packets_first=no if test -n "$ac_cv_ping_command" then AC_MSG_RESULT([(command-line) $ac_cv_ping_command]) - if test -n "$PING_PACKETS_FIRST" + if test -n "$ac_cv_ping_packets_first" then ac_cv_ping_packets_first=yes dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", @@ -1039,7 +1032,7 @@ fi AC_DEFINE_UNQUOTED(PING_COMMAND,"$ac_cv_ping_command", [path and args for ICMP ping command]) -if test x$ac_cv_ping_packets_first != xno +if test "x$ac_cv_ping_packets_first" != "xno" then AC_DEFINE(PING_PACKETS_FIRST,1, [Define if packet count must precede host]) @@ -1048,7 +1041,157 @@ fi AC_ARG_WITH(ping6_command, ACX_HELP_STRING([--with-ping6-command=SYNTAX], [sets syntax for ICMPv6 ping]), - PING6_COMMAND=$withval,) + ac_cv_ping6_command=$withval,) + +AC_MSG_CHECKING(for ICMPv6 ping syntax) +ac_cv_ping6_packets_first=no +if test -n "$ac_cv_ping6_command" +then + AC_MSG_RESULT([(command-line) $ac_cv_ping6_command]) + if test -n "$ac_cv_ping6_packets_first" + then + ac_cv_ping6_packets_first=yes + fi + +elif test "x$PATH_TO_PING6" != "x"; then + if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \ + $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n -U -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n -U -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n %s -c %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 %s -n %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping_command="$PATH_TO_PING6 -n -s 56 -c %d %s" + ac_cv_ping_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping_command]) + + elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING6 -n -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + fi + +elif test "x$PATH_TO_PING" != "x"; then + if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \ + $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 %s -n %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d" + AC_MSG_RESULT([$ac_cv_ping6_command]) + + elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s" + ac_cv_ping_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping_command]) + + elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null + then + ac_cv_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s" + ac_cv_ping6_packets_first=yes + AC_MSG_RESULT([$ac_cv_ping6_command]) + + fi + +fi + +if test "x$ac_cv_ping6_command" != "x"; then + AC_DEFINE_UNQUOTED(PING6_COMMAND,"$ac_cv_ping6_command", + [path and args for ICMPv6 ping command]) +else + AC_MSG_RESULT([none]) +fi + +if test "x$ac_cv_ping6_packets_first" != "xno"; then + AC_DEFINE(PING6_PACKETS_FIRST,1, + [Define if packet count must precede host]) +fi AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup) |