summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-02-18 05:38:28 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-02-18 05:38:28 (GMT)
commitd854505371f42b69f7e5dc495911dfaf1c09f87d (patch)
treeaf7c309834f390e6b2156a2b672a5fd6ac84c594
parent8d461952d4a7ade739313692a6fca78dee68ed1c (diff)
downloadmonitoring-plugins-d854505371f42b69f7e5dc495911dfaf1c09f87d.tar.gz
remainder of ps fix for UnixWare, and move [] in if/elif to indicate m4 quoting instead of test invocation
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@337 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--configure.in98
1 files changed, 51 insertions, 47 deletions
diff --git a/configure.in b/configure.in
index dc5f281..896912b 100644
--- a/configure.in
+++ b/configure.in
@@ -410,7 +410,7 @@ fi
410 410
411AC_PATH_PROG(PATH_TO_PS,ps) 411AC_PATH_PROG(PATH_TO_PS,ps)
412dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND 412dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
413if [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] 413if 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
414then 414then
415 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) 415 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
416 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) 416 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
@@ -424,7 +424,7 @@ then
424 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss]) 424 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss])
425 echo " ps syntax... $PATH_TO_PS -weo 'stat comm vsz rss user ppid args'" 425 echo " ps syntax... $PATH_TO_PS -weo 'stat comm vsz rss user ppid args'"
426dnl FreeBSD 426dnl FreeBSD
427elif [ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID" >/dev/null] 427elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"] >/dev/null
428then 428then
429 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 429 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
430 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) 430 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[])
@@ -438,7 +438,7 @@ then
438 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 438 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
439 echo " ps syntax... $PATH_TO_PS -Ao 'state command vsz rss'" 439 echo " ps syntax... $PATH_TO_PS -Ao 'state command vsz rss'"
440dnl BSD-like mode in RH 6.1 440dnl BSD-like mode in RH 6.1
441elif [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] 441elif 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
442then 442then
443 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 443 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
444 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) 444 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[])
@@ -454,7 +454,7 @@ then
454dnl SunOS 4.1.3: 454dnl SunOS 4.1.3:
455dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND 455dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
456dnl 456dnl
457elif [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] 457elif 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
458then 458then
459 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 459 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
460 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww",[]) 460 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww",[])
@@ -471,7 +471,7 @@ dnl Debian Linux / procps v1.2.9:
471dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND 471dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
472dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2] 472dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
473dnl 473dnl
474elif [ps laxnwww 2>/dev/null | egrep -i "^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND" >/dev/null] 474elif ps laxnwww 2>/dev/null | egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
475then 475then
476 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 476 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
477 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww",[]) 477 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww",[])
@@ -485,7 +485,7 @@ then
485 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d",[]) 485 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d",[])
486 echo " ps syntax... $PATH_TO_PS laxnwww" 486 echo " ps syntax... $PATH_TO_PS laxnwww"
487dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs) 487dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
488elif [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] 488elif 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
489then 489then
490 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) 490 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
491 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) 491 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
@@ -499,7 +499,7 @@ then
499 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss]) 499 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss])
500 echo " ps syntax... $PATH_TO_PS -axo 'stat comm vsz rss user ppid args'" 500 echo " ps syntax... $PATH_TO_PS -axo 'stat comm vsz rss user ppid args'"
501dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT 501dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT
502elif [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] 502elif 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
503then 503then
504 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) 504 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
505 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) 505 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
@@ -512,7 +512,7 @@ then
512 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -ao 'rss comm'",[]) 512 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -ao 'rss comm'",[])
513 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 513 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
514 echo " ps syntax... $PATH_TO_PS -ao 'stat comm vsz rss user ppid args'" 514 echo " ps syntax... $PATH_TO_PS -ao 'stat comm vsz rss user ppid args'"
515elif [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] 515elif 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
516then 516then
517 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) 517 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
518 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) 518 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
@@ -525,7 +525,7 @@ then
525 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -eo 'rss comm'",[]) 525 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -eo 'rss comm'",[])
526 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 526 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
527 echo " ps syntax... $PATH_TO_PS -eo 's comm vsz rss user ppid args'" 527 echo " ps syntax... $PATH_TO_PS -eo 's comm vsz rss user ppid args'"
528elif [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] 528elif 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
529then 529then
530 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) 530 AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
531 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) 531 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
@@ -538,7 +538,7 @@ then
538 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'",[]) 538 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'",[])
539 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 539 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
540 echo " ps syntax... $PATH_TO_PS -Ao 's comm vsz rss'" 540 echo " ps syntax... $PATH_TO_PS -Ao 's comm vsz rss'"
541elif [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] 541elif 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
542then 542then
543 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 543 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
544 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos]) 544 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
@@ -551,7 +551,7 @@ then
551 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'",[]) 551 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'",[])
552 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 552 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
553 echo " ps syntax... $PATH_TO_PS -Ao 'status comm vsz rss'" 553 echo " ps syntax... $PATH_TO_PS -Ao 'status comm vsz rss'"
554elif [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] 554elif 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
555then 555then
556 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 556 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
557 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos]) 557 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
@@ -565,7 +565,7 @@ then
565 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 565 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
566 echo " ps syntax... $PATH_TO_PS -Ao 'state comm vsz rss'" 566 echo " ps syntax... $PATH_TO_PS -Ao 'state comm vsz rss'"
567dnl wonder who takes state instead of stat 567dnl wonder who takes state instead of stat
568elif [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] 568elif 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
569then 569then
570 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 570 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
571 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) 571 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[])
@@ -579,7 +579,7 @@ then
579 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 579 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
580 echo " ps syntax... $PATH_TO_PS -ao 'state command vsz rss'" 580 echo " ps syntax... $PATH_TO_PS -ao 'state command vsz rss'"
581dnl IRIX 53 581dnl IRIX 53
582elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] 582elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
583then 583then
584 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 584 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
585 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) 585 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[])
@@ -591,7 +591,7 @@ then
591 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d",[]) 591 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d",[])
592 echo " ps syntax... $PATH_TO_PS -el" 592 echo " ps syntax... $PATH_TO_PS -el"
593dnl IRIX 63 593dnl IRIX 63
594elif [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] 594elif 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
595then 595then
596 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 596 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
597 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) 597 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[])
@@ -606,7 +606,7 @@ dnl
606dnl AIX 4.1: 606dnl AIX 4.1:
607dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD 607dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
608dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper 608dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
609elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] 609elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
610then 610then
611 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 611 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
612 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) 612 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[])
@@ -618,7 +618,7 @@ then
618 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %d",[]) 618 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %d",[])
619 echo " ps syntax... $PATH_TO_PS -el" 619 echo " ps syntax... $PATH_TO_PS -el"
620dnl AIX? 620dnl AIX?
621elif [ps glaxen 2>/dev/null | egrep -i "^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND" >/dev/null] 621elif ps glaxen 2>/dev/null | egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
622then 622then
623 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 623 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
624 AC_DEFINE_UNQUOTED(PS_VARLIST,[&procuid,&procppid,procstat,&pos,procprog],[]) 624 AC_DEFINE_UNQUOTED(PS_VARLIST,[&procuid,&procppid,procstat,&pos,procprog],[])
@@ -633,7 +633,7 @@ dnl MacOSX / Darwin
633dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT 633dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
634dnl STAT VSZ RSS UID USER PPID UCOMM COMMAND 634dnl STAT VSZ RSS UID USER PPID UCOMM COMMAND
635dnl Ss 1308 272 0 root 0 init /sbin/init 635dnl Ss 1308 272 0 root 0 init /sbin/init
636elif [ps waxo 'state vsz rss uid user ppid ucomm command' 2>/dev/null | egrep -i "^STAT +VSZ +RSS +UID +USER +PPID +UCOMM +COMMAND" >/dev/null] 636elif ps waxo 'state vsz rss uid user ppid ucomm command' 2>/dev/null | egrep -i ["^STAT +VSZ +RSS +UID +USER +PPID +UCOMM +COMMAND"] >/dev/null
637then 637then
638 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) 638 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
639 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) 639 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[])
@@ -646,6 +646,19 @@ then
646 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxco 'rss command'",[]) 646 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxco 'rss command'",[])
647 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) 647 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
648 echo " ps syntax... $PATH_TO_PS waxo 'state vsz rss command'" 648 echo " ps syntax... $PATH_TO_PS waxo 'state vsz rss command'"
649dnl UnixWare
650elif ps -Al 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
651then
652 AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
653 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[])
654 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Al",[])
655 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s",[Format string for scanning ps output in check_procs])
656 if ps -Ao 'vsz comm' 2>/dev/null | egrep -i ["^ *VSZ +COMMAND"] >/dev/null
657 then
658 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'",[])
659 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %d",[])
660 fi
661 echo " ps syntax... $PATH_TO_PS -Al"
649else 662else
650 echo "** Unable to find usable ps syntax" 663 echo "** Unable to find usable ps syntax"
651fi 664fi
@@ -654,25 +667,25 @@ AC_ARG_WITH(df_command,--with-df-command=<syntax> sets syntax for df,DF_COMMAND=
654if test -n "$DF_COMMAND" 667if test -n "$DF_COMMAND"
655then 668then
656 AC_DEFINE_UNQUOTED(DF_COMMAND,"$DF_COMMAND",[path and args for df command]) 669 AC_DEFINE_UNQUOTED(DF_COMMAND,"$DF_COMMAND",[path and args for df command])
657elif [df -Pk 2>/dev/null | egrep -i "^(/dev/|[a-zA-Z]:)[a-z0-9/\\]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/\\]*" >/dev/null] 670elif df -Pk 2>/dev/null | egrep -i ["^(/dev/|[a-zA-Z]:)[a-z0-9/\\]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/\\]*"] >/dev/null
658then 671then
659 AC_PATH_PROG(PATH_TO_DF,df) 672 AC_PATH_PROG(PATH_TO_DF,df)
660 AC_MSG_RESULT(" df syntax... $PATH_TO_DF -Pk") 673 AC_MSG_RESULT([ df syntax... $PATH_TO_DF -Pk])
661 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -Pk",[path and args for df command]) 674 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -Pk",[path and args for df command])
662elif [df -k 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] 675elif df -k 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
663then 676then
664 AC_PATH_PROG(PATH_TO_DF,df) 677 AC_PATH_PROG(PATH_TO_DF,df)
665 AC_MSG_RESULT(" df syntax... $PATH_TO_DF -k") 678 AC_MSG_RESULT([ df syntax... $PATH_TO_DF -k])
666 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -k",[path and args for df command]) 679 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -k",[path and args for df command])
667elif [df 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] 680elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
668then 681then
669 AC_PATH_PROG(PATH_TO_DF,df) 682 AC_PATH_PROG(PATH_TO_DF,df)
670 AC_MSG_RESULT(" df syntax... $PATH_TO_DF") 683 AC_MSG_RESULT([ df syntax... $PATH_TO_DF])
671 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command]) 684 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command])
672elif [bdf 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] 685elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
673then 686then
674 AC_PATH_PROG(PATH_TO_DF,bdf) 687 AC_PATH_PROG(PATH_TO_DF,bdf)
675 AC_MSG_RESULT(" df syntax... $PATH_TO_DF") 688 AC_MSG_RESULT([ df syntax... $PATH_TO_DF])
676 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command]) 689 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command])
677else 690else
678 AC_MSG_WARN("unable to find usable df syntax") 691 AC_MSG_WARN("unable to find usable df syntax")
@@ -688,43 +701,43 @@ then
688 then 701 then
689 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) 702 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host])
690 fi 703 fi
691elif [ "z$ac_cv_uname_s" == "zUnixWare" && ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 704elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
692then 705then
693 PING_COMMAND="$PATH_TO_PING -n -U -c %d %s" 706 PING_COMMAND="$PATH_TO_PING -n -U -c %d %s"
694 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) 707 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host])
695 echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>" 708 echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>"
696elif [ping -n -U -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 709elif ping -n -U -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
697then 710then
698 PING_COMMAND="$PATH_TO_PING -n -U -c %d %s" 711 PING_COMMAND="$PATH_TO_PING -n -U -c %d %s"
699 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) 712 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host])
700 echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>" 713 echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>"
701elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 714elif ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
702then 715then
703 PING_COMMAND="$PATH_TO_PING -n -c %d %s" 716 PING_COMMAND="$PATH_TO_PING -n -c %d %s"
704 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) 717 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host])
705 echo " ping syntax... $PATH_TO_PING -n -c <count> <host>" 718 echo " ping syntax... $PATH_TO_PING -n -c <count> <host>"
706elif [ping -n 127.0.0.1 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 719elif ping -n 127.0.0.1 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
707then 720then
708 PING_COMMAND="$PATH_TO_PING -n %s -c %d" 721 PING_COMMAND="$PATH_TO_PING -n %s -c %d"
709 echo " ping syntax... $PATH_TO_PING -n <host> -c <count>" 722 echo " ping syntax... $PATH_TO_PING -n <host> -c <count>"
710elif [ping 127.0.0.1 -n 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 723elif ping 127.0.0.1 -n 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
711then 724then
712 PING_COMMAND="$PATH_TO_PING %s -n %d" 725 PING_COMMAND="$PATH_TO_PING %s -n %d"
713 echo " ping syntax... $PATH_TO_PING <host> -n <count>" 726 echo " ping syntax... $PATH_TO_PING <host> -n <count>"
714elif [ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 727elif ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
715then 728then
716 PING_COMMAND="$PATH_TO_PING -n -s %s 56 %d" 729 PING_COMMAND="$PATH_TO_PING -n -s %s 56 %d"
717 echo " ping syntax... $PATH_TO_PING -n -s <host> 56 <count>" 730 echo " ping syntax... $PATH_TO_PING -n -s <host> 56 <count>"
718elif [ping -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 731elif ping -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
719then 732then
720 PING_COMMAND="$PATH_TO_PING -n -h %s -s 56 -c %d" 733 PING_COMMAND="$PATH_TO_PING -n -h %s -s 56 -c %d"
721 echo " ping syntax... $PATH_TO_PING -n -h <host> -s 56 -c <count>" 734 echo " ping syntax... $PATH_TO_PING -n -h <host> -s 56 -c <count>"
722elif [ping -n -s 56 -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 735elif ping -n -s 56 -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
723then 736then
724 PING_COMMAND="$PATH_TO_PING -n -s 56 -c %d %s" 737 PING_COMMAND="$PATH_TO_PING -n -s 56 -c %d %s"
725 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) 738 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host])
726 echo " ping syntax... $PATH_TO_PING -n -s 56 -c <count> <host>" 739 echo " ping syntax... $PATH_TO_PING -n -s 56 -c <count> <host>"
727elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] 740elif ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null
728then 741then
729 PING_COMMAND="$PATH_TO_PING -n -c %d %s" 742 PING_COMMAND="$PATH_TO_PING -n -c %d %s"
730 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) 743 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host])
@@ -737,32 +750,23 @@ AC_DEFINE_UNQUOTED(PING_COMMAND,"$PING_COMMAND",[path and args for ping command]
737AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup) 750AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
738if test -n "$ac_cv_path_PATH_TO_NSLOOKUP" 751if test -n "$ac_cv_path_PATH_TO_NSLOOKUP"
739then 752then
740 AC_MSG_CHECKING("nslookup syntax") 753 if nslookup -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
741 if [nslookup -sil 127.0.0.1 2>&1 | grep "Invalid option: sil" >/dev/null]
742 then 754 then
743 AC_MSG_RESULT("$PATH_TO_NSLOOKUP") 755 AC_MSG_RESULT([ nslookup syntax... $PATH_TO_NSLOOKUP])
744 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP",[path and args for nslookup]) 756 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP",[path and args for nslookup])
745 else 757 else
746 AC_MSG_RESULT("$PATH_TO_NSLOOKUP -sil") 758 AC_MSG_RESULT([ nslookup syntax... $PATH_TO_NSLOOKUP -sil])
747 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP -sil",[path and args for nslookup]) 759 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP -sil",[path and args for nslookup])
748 fi 760 fi
749 EXTRAS="$EXTRAS check_dns" 761 EXTRAS="$EXTRAS check_dns"
750else 762else
751 AC_MSG_WARN("nslookup command not found") 763 AC_MSG_WARN([nslookup command not found])
752fi 764fi
753 765
754AC_PATH_PROG(PATH_TO_HOST,host) 766AC_PATH_PROG(PATH_TO_HOST,host)
755if test -n "$ac_cv_path_PATH_TO_HOST" 767if test -n "$ac_cv_path_PATH_TO_HOST"
756then 768then
757 AC_MSG_CHECKING("host syntax")
758 if [host 127.0.0.1 2>&1 | grep -v "ommand not found" > /dev/null]
759 then
760 AC_MSG_RESULT("$PATH_TO_HOST")
761 AC_DEFINE_UNQUOTED(HOST_COMMAND,"$PATH_TO_HOST",[path to host binary])
762 fi
763 EXTRAS="$EXTRAS check_dns" 769 EXTRAS="$EXTRAS check_dns"
764else
765 AC_MSG_WARN("host command not found")
766fi 770fi
767 771
768AC_PATH_PROG(PATH_TO_UPTIME,uptime) 772AC_PATH_PROG(PATH_TO_UPTIME,uptime)