[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netsaint-devel
Subject:    [netsaint-devel] Another try to ditribute the Solaris patches and a new plugin
From:       Rene Klootwijk <rene () klootwijk ! org>
Date:       2000-01-19 14:08:17
[Download RAW message or body]

Now the patches and plugin are attached in text format instead of binary
format (zipped).



The check_netsaint plugin will not work on Solaris because the ps -awx
command, as defined within config.h, is not supported. I patched the
configure script and common/config.h.in. After this patch
(patch1/ps_raw_command)
the ps command that will be used by check_netsaint will be ps -eo
's,user,ppid,args' which works on both linux (at least with the ps
coming with Redhat 6.x) and Solaris. The configure script will test if
this option really is supported and changes config.h accordingly.

Steps to following to use patch1:
1. Copy and unpack patch1.gz in the plugin source directory
(netsaint-plugins-1.2.7-20000117).
2. cat patch1 |  patch -p1 (configure, configure.in and
common/config.h.in will now be patched)


I wrote a new process monitor plugin (check_process.c) . This plugin
can check the following:
- Is a specific process running
- Is a specific process not running
- Are there to many instances of a specific process
- Are there to less instances of a specific process running
- Is a specific process running under a specific user
- and many more

Patch2 (patch2/check_process) patches the plugin distribution
(1.2.7-20000117) to
include this new plugin.


Steps to follow to use the new plugin (patch2):
1. Install patch1
2. Copy and unpack patch2.gz in the plugin distribution source directory
(netsaint-plugins-1.2.7-20000117).
3. cat patch2 |  patch -p1 (Makefile.in and plugins/Makefile.in will now
be patched)
4. Copy and unpack check_process.c.gz in the plugins source direcotry
(netsaint-plugins-1.2.7-20000117/plugins).

Regards,
Rene.
["ps_raw_command" (text/plain)]

diff -ur netsaint-plugins-1.2.7-20000117/common/config.h.in \
                patched/common/config.h.in
--- netsaint-plugins-1.2.7-20000117/common/config.h.in	Thu Jan 13 22:34:29 2000
+++ patched/common/config.h.in	Wed Jan 19 17:08:31 2000
@@ -31,7 +31,7 @@
 
 #define PS_COMMAND ""
 #define PS_FORMAT ""
-#define PS_RAW_COMMAND "/bin/ps -axw"
+#define PS_RAW_COMMAND ""
 #define VSZ_COMMAND ""
 #define VSZ_FORMAT ""
 #define RSS_COMMAND ""
diff -ur netsaint-plugins-1.2.7-20000117/configure patched/configure
--- netsaint-plugins-1.2.7-20000117/configure	Mon Jan 17 19:45:47 2000
+++ patched/configure	Wed Jan 19 17:08:48 2000
@@ -686,6 +686,16 @@
   echo "$ac_t""no" 1>&6
 fi
 
+if ps -eo 's user ppid args' 2>/dev/null | egrep -s -i "^S[TAUES]* +U[SER]+ +P[PID]+ \
[RGSCOMDNA]+" +then
+        cat >> confdefs.h <<EOF
+#define PS_RAW_COMMAND "$PATH_TO_PS -eo 's user ppid args'"
+EOF
+
+        echo "      ps syntax... $PATH_TO_PS -eo 's user ppid args'"
+else
+	echo "      unable to find a ps syntax for check_netsaint and check_process"
+fi
 if ps -Ao 's comm vsz rss' 2>/dev/null | egrep -s -i "^S[TAUES]* +C[OMDNA]+ \
+[VSIZE]+"  then
 	cat >> confdefs.h <<EOF
@@ -857,7 +867,7 @@
 	# Extract the first word of "df", so it can be a program name with args.
 set dummy df; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:861: checking for $ac_word" >&5
+echo "configure:871: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_DF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -899,7 +909,7 @@
 	# Extract the first word of "df", so it can be a program name with args.
 set dummy df; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:903: checking for $ac_word" >&5
+echo "configure:913: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_DF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -941,7 +951,7 @@
 	# Extract the first word of "bdf", so it can be a program name with args.
 set dummy bdf; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:945: checking for $ac_word" >&5
+echo "configure:955: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_DF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -985,7 +995,7 @@
 # Extract the first word of "ping", so it can be a program name with args.
 set dummy ping; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:989: checking for $ac_word" >&5
+echo "configure:999: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_PING'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1074,7 +1084,7 @@
 # Extract the first word of "nslookup", so it can be a program name with args.
 set dummy nslookup; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1078: checking for $ac_word" >&5
+echo "configure:1088: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_NSLOOKUP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1114,7 +1124,7 @@
 # Extract the first word of "uptime", so it can be a program name with args.
 set dummy uptime; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1118: checking for $ac_word" >&5
+echo "configure:1128: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_UPTIME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1154,7 +1164,7 @@
 # Extract the first word of "who", so it can be a program name with args.
 set dummy who; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1158: checking for $ac_word" >&5
+echo "configure:1168: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_WHO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1194,7 +1204,7 @@
 # Extract the first word of "snmpget", so it can be a program name with args.
 set dummy snmpget; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1198: checking for $ac_word" >&5
+echo "configure:1208: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_SNMPGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1240,7 +1250,7 @@
 # Extract the first word of "qstat", so it can be a program name with args.
 set dummy qstat; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1244: checking for $ac_word" >&5
+echo "configure:1254: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_QSTAT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1286,7 +1296,7 @@
 # Extract the first word of "fping", so it can be a program name with args.
 set dummy fping; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1290: checking for $ac_word" >&5
+echo "configure:1300: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_FPING'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1332,7 +1342,7 @@
 # Extract the first word of "ssh", so it can be a program name with args.
 set dummy ssh; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1336: checking for $ac_word" >&5
+echo "configure:1346: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_SSH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1398,7 +1408,7 @@
 	# Extract the first word of "swap", so it can be a program name with args.
 set dummy swap; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1402: checking for $ac_word" >&5
+echo "configure:1412: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_SWAP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1460,7 +1470,7 @@
 	# Extract the first word of "swapinfo", so it can be a program name with args.
 set dummy swapinfo; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1464: checking for $ac_word" >&5
+echo "configure:1474: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_SWAP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1510,7 +1520,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1514: checking for $ac_word" >&5
+echo "configure:1524: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1540,7 +1550,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1544: checking for $ac_word" >&5
+echo "configure:1554: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1591,7 +1601,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1595: checking for $ac_word" >&5
+echo "configure:1605: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1623,7 +1633,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" \
                1>&6
-echo "configure:1627: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" \
>&5 +echo "configure:1637: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) \
> works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1634,12 +1644,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1638 "configure"
+#line 1648 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1653: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  \
ac_cv_prog_cc_works=yes  # If we can't run a trivial program, we are probably using a \
cross compiler.  if (./conftest; exit) 2>/dev/null; then
@@ -1665,12 +1675,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot \
create executables." 1>&2; exit 1; }  fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a \
                cross-compiler""... $ac_c" 1>&6
-echo "configure:1669: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a \
cross-compiler" >&5 +echo "configure:1679: checking whether the C compiler ($CC \
$CFLAGS $LDFLAGS) is a cross-compiler" >&5  echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1674: checking whether we are using GNU C" >&5
+echo "configure:1684: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1679,7 +1689,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1683: \"$ac_try\") \
1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { \
ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1693: \"$ac_try\") 1>&5; \
(eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then  ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1698,7 +1708,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1702: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1712: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1730,7 +1740,7 @@
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1734: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1744: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1758,7 +1768,7 @@
 
 
 echo $ac_n "checking for main in -ldce""... $ac_c" 1>&6
-echo "configure:1762: checking for main in -ldce" >&5
+echo "configure:1772: checking for main in -ldce" >&5
 ac_lib_var=`echo dce'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1766,14 +1776,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldce  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1770 "configure"
+#line 1780 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1787: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1794,7 +1804,7 @@
 fi
 
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1798: checking for main in -lnsl" >&5
+echo "configure:1808: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1802,14 +1812,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1806 "configure"
+#line 1816 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1823: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1830,7 +1840,7 @@
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1834: checking for socket in -lsocket" >&5
+echo "configure:1844: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1838,7 +1848,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1842 "configure"
+#line 1852 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1849,7 +1859,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1863: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1870,7 +1880,7 @@
 fi
 
 echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6
-echo "configure:1874: checking for main in -lresolv" >&5
+echo "configure:1884: checking for main in -lresolv" >&5
 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1878,14 +1888,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1882 "configure"
+#line 1892 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1899: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1906,7 +1916,7 @@
 fi
 
 echo $ac_n "checking for main in -lpq""... $ac_c" 1>&6
-echo "configure:1910: checking for main in -lpq" >&5
+echo "configure:1920: checking for main in -lpq" >&5
 ac_lib_var=`echo pq'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1914,14 +1924,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lpq -lcrypt $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1918 "configure"
+#line 1928 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1935: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1943,7 +1953,7 @@
 fi
 
 echo $ac_n "checking for main in -lldap""... $ac_c" 1>&6
-echo "configure:1947: checking for main in -lldap" >&5
+echo "configure:1957: checking for main in -lldap" >&5
 ac_lib_var=`echo ldap'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1951,14 +1961,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lldap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1955 "configure"
+#line 1965 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:1972: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1974,12 +1984,12 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:1978: checking for getopt_long" >&5
+echo "configure:1988: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1983 "configure"
+#line 1993 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -2002,7 +2012,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2016: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -2026,7 +2036,7 @@
 fi
 
 echo $ac_n "checking for main in -lmysql""... $ac_c" 1>&6
-echo "configure:2030: checking for main in -lmysql" >&5
+echo "configure:2040: checking for main in -lmysql" >&5
 ac_lib_var=`echo mysql'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2034,14 +2044,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lmysql  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2038 "configure"
+#line 2048 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2055: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2062,7 +2072,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2066: checking how to run the C preprocessor" >&5
+echo "configure:2076: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2077,13 +2087,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2081 "configure"
+#line 2091 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2094,13 +2104,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2098 "configure"
+#line 2108 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2111,13 +2121,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2115 "configure"
+#line 2125 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2147,7 +2157,7 @@
 # On Solaris, -lkvm requires nlist from -lelf, so check that first
 # to get the right answer into the cache.
 echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6
-echo "configure:2151: checking for elf_begin in -lelf" >&5
+echo "configure:2161: checking for elf_begin in -lelf" >&5
 ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2155,7 +2165,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lelf  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2159 "configure"
+#line 2169 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2166,7 +2176,7 @@
 elf_begin()
 ; return 0; }
 EOF
-if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2180: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2187,7 +2197,7 @@
 fi
 
 echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6
-echo "configure:2191: checking for kvm_open in -lkvm" >&5
+echo "configure:2201: checking for kvm_open in -lkvm" >&5
 ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2195,7 +2205,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lkvm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2199 "configure"
+#line 2209 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2206,7 +2216,7 @@
 kvm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:2210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2220: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2228,7 +2238,7 @@
 
 # Check for the 4.4BSD definition of getloadavg.
 echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6
-echo "configure:2232: checking for getloadavg in -lutil" >&5
+echo "configure:2242: checking for getloadavg in -lutil" >&5
 ac_lib_var=`echo util'_'getloadavg | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2236,7 +2246,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2240 "configure"
+#line 2250 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2247,7 +2257,7 @@
 getloadavg()
 ; return 0; }
 EOF
-if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2261: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2273,7 +2283,7 @@
   # Since it is not a standard part of AIX, it might be installed locally.
   ac_getloadavg_LIBS="$LIBS"; LIBS="-L/usr/local/lib $LIBS"
   echo $ac_n "checking for getloadavg in -lgetloadavg""... $ac_c" 1>&6
-echo "configure:2277: checking for getloadavg in -lgetloadavg" >&5
+echo "configure:2287: checking for getloadavg in -lgetloadavg" >&5
 ac_lib_var=`echo getloadavg'_'getloadavg | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2281,7 +2291,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgetloadavg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2285 "configure"
+#line 2295 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2292,7 +2302,7 @@
 getloadavg()
 ; return 0; }
 EOF
-if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2306: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2319,12 +2329,12 @@
 for ac_func in getloadavg
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2323: checking for $ac_func" >&5
+echo "configure:2333: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2328 "configure"
+#line 2338 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2347,7 +2357,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2361: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2385,17 +2395,17 @@
   ac_have_func=no
   ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6
-echo "configure:2389: checking for sys/dg_sys_info.h" >&5
+echo "configure:2399: checking for sys/dg_sys_info.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2394 "configure"
+#line 2404 "configure"
 #include "confdefs.h"
 #include <sys/dg_sys_info.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2416,7 +2426,7 @@
 EOF
 
   echo $ac_n "checking for dg_sys_info in -ldgc""... $ac_c" 1>&6
-echo "configure:2420: checking for dg_sys_info in -ldgc" >&5
+echo "configure:2430: checking for dg_sys_info in -ldgc" >&5
 ac_lib_var=`echo dgc'_'dg_sys_info | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2424,7 +2434,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldgc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2428 "configure"
+#line 2438 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2435,7 +2445,7 @@
 dg_sys_info()
 ; return 0; }
 EOF
-if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:2449: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2480,17 +2490,17 @@
   if test $ac_have_func = no; then
     ac_safe=`echo "inq_stats/cpustats.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6
-echo "configure:2484: checking for inq_stats/cpustats.h" >&5
+echo "configure:2494: checking for inq_stats/cpustats.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2489 "configure"
+#line 2499 "configure"
 #include "confdefs.h"
 #include <inq_stats/cpustats.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2523,17 +2533,17 @@
   if test $ac_have_func = no; then
     ac_safe=`echo "sys/cpustats.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6
-echo "configure:2527: checking for sys/cpustats.h" >&5
+echo "configure:2537: checking for sys/cpustats.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2532 "configure"
+#line 2542 "configure"
 #include "confdefs.h"
 #include <sys/cpustats.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2564,17 +2574,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2568: checking for $ac_hdr" >&5
+echo "configure:2578: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2573 "configure"
+#line 2583 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2604,17 +2614,17 @@
 
   ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:2608: checking for nlist.h" >&5
+echo "configure:2618: checking for nlist.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2613 "configure"
+#line 2623 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2635,19 +2645,19 @@
 EOF
 
   echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6
-echo "configure:2639: checking for n_un in struct nlist" >&5
+echo "configure:2649: checking for n_un in struct nlist" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2644 "configure"
+#line 2654 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 int main() {
 struct nlist n; n.n_un.n_name = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:2661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   ac_cv_struct_nlist_n_un=yes
 else
@@ -2674,12 +2684,12 @@
 
 # Some definitions of getloadavg require that the program be installed setgid.
 echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6
-echo "configure:2678: checking whether getloadavg requires setgid" >&5
+echo "configure:2688: checking whether getloadavg requires setgid" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2683 "configure"
+#line 2693 "configure"
 #include "confdefs.h"
 #include "$srcdir/getloadavg.c"
 #ifdef LDAV_PRIVILEGED
@@ -2710,7 +2720,7 @@
 
 if test $ac_cv_func_getloadavg_setgid = yes; then
   echo $ac_n "checking group of /dev/kmem""... $ac_c" 1>&6
-echo "configure:2714: checking group of /dev/kmem" >&5
+echo "configure:2724: checking group of /dev/kmem" >&5
 if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2737,12 +2747,12 @@
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2741: checking for ANSI C header files" >&5
+echo "configure:2751: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2746 "configure"
+#line 2756 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2750,7 +2760,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2767,7 +2777,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2771 "configure"
+#line 2781 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2785,7 +2795,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2789 "configure"
+#line 2799 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2806,7 +2816,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2810 "configure"
+#line 2820 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2817,7 +2827,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo \
configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s \
conftest${ac_exeext} && (./conftest; exit) 2>/dev/null  then
   :
 else
@@ -2841,12 +2851,12 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" \
                1>&6
-echo "configure:2845: checking whether time.h and sys/time.h may both be included" \
>&5 +echo "configure:2855: checking whether time.h and sys/time.h may both be \
> included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2850 "configure"
+#line 2860 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2855,7 +2865,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2876,12 +2886,12 @@
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2880: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2890: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2885 "configure"
+#line 2895 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2897,7 +2907,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:2911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2921,17 +2931,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2925: checking for $ac_hdr" >&5
+echo "configure:2935: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2930 "configure"
+#line 2940 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2959,12 +2969,12 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2963: checking for working const" >&5
+echo "configure:2973: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2968 "configure"
+#line 2978 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3013,7 +3023,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:3027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3034,12 +3044,12 @@
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3038: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3048: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3043 "configure"
+#line 3053 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3047,7 +3057,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:3061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3070,12 +3080,12 @@
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3074: checking return type of signal handlers" >&5
+echo "configure:3084: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3079 "configure"
+#line 3089 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3092,7 +3102,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:3106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3113,12 +3123,12 @@
 for ac_func in select socket strdup strstr strtod strtoul
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3117: checking for $ac_func" >&5
+echo "configure:3127: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3122 "configure"
+#line 3132 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3141,7 +3151,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test \
-s conftest${ac_exeext}; then +if { (eval echo configure:3155: \"$ac_link\") 1>&5; \
(eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then  rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3167,9 +3177,9 @@
 
 
 echo $ac_n "checking for type of socket size""... $ac_c" 1>&6
-echo "configure:3171: checking for type of socket size" >&5
+echo "configure:3181: checking for type of socket size" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3173 "configure"
+#line 3183 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <sys/types.h>
@@ -3179,7 +3189,7 @@
 int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);
 ; return 0; }
 EOF
-if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; \
then +if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; \
}; then  rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define SOCKET_SIZE_TYPE size_t
diff -ur netsaint-plugins-1.2.7-20000117/configure.in patched/configure.in
--- netsaint-plugins-1.2.7-20000117/configure.in	Mon Jan 17 19:45:33 2000
+++ patched/configure.in	Wed Jan 19 17:08:22 2000
@@ -26,6 +26,13 @@
 
 
 AC_PATH_PROG(PATH_TO_PS,ps)
+if [ps -eo 's user ppid args' 2>/dev/null | egrep -s -i "^S[TAUES]* +U[SER]+ \
+P[PID]+ [RGSCOMDNA]+"] +then
+        AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -eo 's user ppid args'")
+        echo "      ps syntax... $PATH_TO_PS -eo 's user ppid args'"
+else
+	echo "      unable to find a ps syntax for check_netsaint and check_process"
+fi
 if [ps -Ao 's comm vsz rss' 2>/dev/null | egrep -s -i "^S[TAUES]* +C[OMDNA]+ \
+[VSIZE]+"]  then
 	AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 's'")


["check_process" (text/plain)]

diff -ur netsaint-plugins-1.2.7-20000117/Makefile.in patched/Makefile.in
--- netsaint-plugins-1.2.7-20000117/Makefile.in	Fri Dec 10 07:08:58 1999
+++ patched/Makefile.in	Wed Jan 19 17:09:18 2000
@@ -32,7 +32,8 @@
 		check_netsaint check_nntp check_nwstat check_overcr \
 		check_ping check_pop check_procs check_real check_reply \
 		check_smtp check_ssh check_tcp check_time check_udp \
-		check_ups check_users check_vsz check_by_ssh $(EXTRAS)
+		check_ups check_users check_vsz check_by_ssh check_process \
+                $(EXTRAS)
 
 PLUGINHDRS=	$(CFG)/common.h
 NETLIBS=	$(SRC)/netutils.o
diff -ur netsaint-plugins-1.2.7-20000117/plugins/Makefile.in patched/plugins/Makefile.in
--- netsaint-plugins-1.2.7-20000117/plugins/Makefile.in	Fri Dec 10 07:09:12 1999
+++ patched/plugins/Makefile.in	Wed Jan 19 17:09:32 2000
@@ -28,7 +28,8 @@
 		check_netsaint check_nntp check_nwstat check_overcr \
 		check_ping check_pop check_procs check_real check_reply \
 		check_smtp check_ssh check_tcp check_time check_udp \
-		check_ups check_users check_vsz check_by_ssh $(EXTRAS)
+		check_ups check_users check_vsz check_by_ssh check_process \
+                $(EXTRAS)
 
 PLUGINHDRS=	$(CFG)/common.h $(CFG)/config.h
 
@@ -169,6 +170,9 @@
 
 check_by_ssh: check_by_ssh.c popen.o
 	$(COMPILE) check_by_ssh.c popen.o -o $@
+
+check_process: check_process.c popen.o $(PLUGINHDRS)
+	$(COMPILE) check_process.c popen.o -o $@
 
 ##############################################################################
 # secondary dependencies
Only in patched/plugins: check_process.c

["check_process.c" (text/plain)]

/******************************************************************************
 *
 * CHECK_PROCESS.C
 *
 * Program: Process plugin for NetSaint
 * License: GPL
 * Copyright (c) 2000 Rene Klootwijk (rene@klootwijk.org)
 *
 * Last Modified: 01-18-2000
 *
 * Command line: CHECK_PROCESS <limit> [-s state] [-u user] [-p ppid] [-c cmd]
 *
 * Description:
 *
 * This plugin determines the current entries in the process table and uses
 * the command line parameters state, user, ppid and cmd to filter the list.
 * The low, high and exact parameters are used to check on the number of
 * matches. At least one limit has to be specified using the low, high or
 * exact parameters. 
 *
 *
 * License Information:
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 ******************************************************************************/

#include <stdlib.h>
#include "../common/config.h"
#include "../common/common.h"
#include "popen.h"

/* Constants used to compute a checksum */
#define STATE    1
#define USER     2
#define PPID     4
#define CMD      8
#define HIGH     16
#define LOW      32
#define EXACT    64

int usage(void) {
  printf("\nProcess plugin for NetSaint\n");
  printf("Copyright (c) 2000, Rene Klootwijk (rene@klootwijk.org)\n");
  printf("Last Modified: 01-18-2000\n");
  printf("License: GPL\n\n");

  printf("Usage: check_process <limit> [-s state] [-u user] [-p ppid] [-c cmd]\n");
  printf("limit, the specified limits determine when the plugin returns an\n");
  printf("       OK or a CRITICAL state. Limits can be specified using the\n");
  printf("       following parameters:\n");
  printf("       -l low,   to specify the minimum number of processes that\n");
  printf("                 should match the criteria.\n");
  printf("       -h high,  to specify the maximum number of processes that\n");
  printf("                 should match the criteria\n");
  printf("       -e exact, the exact number of processes that should match\n");
  printf("                 the criteria\n");
  printf("       Note: -e cannot be used together with -l and/or -h!\n");
  printf("state, state of the process (O,S,R,Z or T) (default = all)\n");
  printf("user,  effective user ID (textual) of the process (default = all)\n");
  printf("ppid,  ID of the parent process (default = all)\n");
  printf("cmd,   a string to identify the process. This string must be a\n");
  printf("       part of the cmd line as displayed in the ps command\n");
  printf("       (default = all)\n\n");
  printf("This plugin determines the current entries in the process table\n");
  printf("and uses the command line parameters state, user, ppid and cmd to\n");
  printf("filter the list. The low, high and exact parameters are used to\n");
  printf("check on the number of matches. At least one limit has to be\n");
  printf("specified using the low, high or exact parameters.\n"); 
  
  return;
}


int main(int argc, char **argv){
  char input_buffer[MAX_INPUT_BUFFER];
  char tmp_buffer[MAX_INPUT_BUFFER];
  char cmd[MAX_INPUT_BUFFER];
  char proc_cmd[MAX_INPUT_BUFFER];
  FILE *fp;
  int ppid, proc_ppid;
  char user[9],proc_user[9];
  char state[6], proc_state[6];
  char state_options[] = "RSTZD";
  int i, c;
  int high = 0;
  int low = 0;
  int exact = 0;
  int checksum = 0;
  int options = 0;
  int resultsum, matched;
  pid_t my_ppid;


  /* Check if for any command line parameters */ 
  if (argc == 1) {
    printf("ERROR: No parameters specified!\n\n");
    usage();
    exit(STATE_UNKNOWN);
  }
  

  /* Process command line parameters */
  while((c = getopt(argc, argv, "s:u:p:c:h:l:e:")) != EOF) {
    switch(c) {
      case 's':
        strncpy(state,optarg,sizeof(state) - 1);
        for(i = 0 ; i < strlen(state) ; i++) {
          if(strchr(state_options,state[i]) == NULL) {
            printf("ERROR: Invalid process state specified!\n\n");
            usage();
            exit(STATE_UNKNOWN);
          }
        }
        options |= STATE;
        checksum |= STATE;
        break;

      case 'u':
        strncpy(user,optarg,sizeof(user) - 1);
        options |= USER;
        checksum |= USER;
        break;

      case 'p':
        ppid = atoi(optarg);
        options |= PPID;
        checksum |= PPID;
        break;

      case 'c':
        strncpy(cmd,optarg,sizeof(cmd) - 1);
        options |= CMD;
        checksum |= CMD;
        break;

      case 'h':
        high = atoi(optarg);
        options |= HIGH;
        break;

      case 'l':
        low = atoi(optarg);
        options |= LOW;
        break;

      case 'e':
        exact = atoi(optarg);
        options |= EXACT;
        break;

      default:
        printf("ERROR: Invalid parameter specified!\n\n");
        usage();
        exit(STATE_UNKNOWN);
    }
  }
  if((options & EXACT) && ((options & LOW) || (options & HIGH))) {
    printf("ERROR: -e cannot be defined together with -h and/or -l\n\n");
    usage();
    exit(STATE_UNKNOWN);
  }
  if(!((options & EXACT) || (options & LOW) || (options & HIGH))) {
    printf("ERROR: No limits are specified (-e, -l or -h)!\n");
    usage();
    exit(STATE_UNKNOWN);
  }

  /* Run the PS command */
  fp=spopen(PS_RAW_COMMAND);
  if(fp==NULL){
    printf("ERROR: Could not open pipe: %s\n",PS_COMMAND);
    return STATE_UNKNOWN;
  }

  /* Obtain the ID of the parent process */
  my_ppid = getppid();

  /* Ignore the header line */
  fgets(input_buffer,MAX_INPUT_BUFFER-1,fp);

  /* Process process table */
  matched = 0;
  while(fgets(input_buffer,MAX_INPUT_BUFFER-1,fp)){
    resultsum = 0;
    /* Determine column values */
    strcpy(tmp_buffer,input_buffer);
    strcpy(proc_state,strtok(tmp_buffer," "));
    strcpy(proc_user,strtok(NULL," "));
    proc_ppid  = atoi(strtok(NULL," "));
    strcpy(proc_cmd,strtok(NULL,"@"));

    /* Do not process this process (the calling process) */
    if(proc_ppid == my_ppid) { continue; }

    /* Process column values */
    if(options & STATE) {
      if(strstr(state,proc_state) != NULL) { resultsum |= STATE; }
    }
    if(options & USER) {
      if(strcmp(user,proc_user) == 0) { resultsum |= USER; }
    }
    if (options & CMD) {
      if(strstr(proc_cmd,cmd) != NULL) { resultsum |= CMD; }
    }
    if(options & PPID) {
      if(ppid == proc_ppid) { resultsum |= PPID; }
    }
    if(checksum == resultsum) { matched++; }
  }
  /* close the pipe */
  spclose(fp);

  /* Determine the return message and code of this plugin */ 
  if ((matched < low) && (options & LOW)) {
    printf("Too less processes matched the specified criteria (%d).\n",matched);
    exit(STATE_CRITICAL);
  }
  if ((matched > high) && (options & HIGH)) {
    printf("Too many processes matched the specified criteria (%d).\n",matched);
    exit(STATE_CRITICAL);
  }
  if ((matched != exact) && (options & EXACT)) {
    printf("The number of processes that matched the specified criteria is not equal \
to the specified number (%d).\n",matched);  exit(STATE_CRITICAL);
  }

  printf("%d processes matched the specified criteria.\n",matched);
  exit(STATE_OK);
}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic