summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in305
1 files changed, 175 insertions, 130 deletions
diff --git a/configure.in b/configure.in
index 5596e2d..fcd5c56 100644
--- a/configure.in
+++ b/configure.in
@@ -446,7 +446,7 @@ AC_HEADER_STDC
446AC_HEADER_TIME 446AC_HEADER_TIME
447AC_HEADER_SYS_WAIT 447AC_HEADER_SYS_WAIT
448AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h unistd.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h) 448AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h unistd.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h)
449AC_CHECK_HEADERS(stdarg.h sys/unistd.h unistd.h ctype.h sys/wait.h stdlib.h) 449AC_CHECK_HEADERS(stdarg.h sys/unistd.h unistd.h ctype.h stdlib.h)
450 450
451dnl Checks for typedefs, structures, and compiler characteristics. 451dnl Checks for typedefs, structures, and compiler characteristics.
452AC_C_CONST 452AC_C_CONST
@@ -531,15 +531,18 @@ AC_TRY_COMPILE([#include <sys/time.h>],
531dnl Checks for library functions. 531dnl Checks for library functions.
532AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul) 532AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
533 533
534AC_MSG_CHECKING(for type of socket size) 534AC_MSG_CHECKING(return type of socket size)
535AC_TRY_COMPILE([#include <stdlib.h> 535AC_TRY_COMPILE([#include <stdlib.h>
536 #include <sys/types.h> 536 #include <sys/types.h>
537 #include <sys/socket.h>], 537 #include <sys/socket.h>],
538 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);], 538 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
539 [AC_DEFINE(SOCKET_SIZE_TYPE, size_t, [Define type of socket size]) 539 ac_cv_socket_size_type=["size_t"]
540 AC_MSG_RESULT(size_t)], 540 AC_MSG_RESULT(size_t),
541 [AC_DEFINE(SOCKET_SIZE_TYPE, int, [Define type of socket size]) 541 ac_cv_socket_size_type=["int"]
542 AC_MSG_RESULT(int)]) 542 AC_MSG_RESULT(int))
543
544AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
545 [Define type of socket size])
543 546
544if test -f "/proc/loadavg" 547if test -f "/proc/loadavg"
545then 548then
@@ -552,6 +555,7 @@ dnl #### Process table test
552AC_PATH_PROG(PATH_TO_PS,ps) 555AC_PATH_PROG(PATH_TO_PS,ps)
553ac_cv_use_ps_vars=no 556ac_cv_use_ps_vars=no
554 557
558AC_MSG_CHECKING(for ps syntax)
555dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND 559dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
556if ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \ 560if ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
557 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ \ 561 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ \
@@ -567,7 +571,7 @@ then
567 ac_cv_rss_command="$PATH_TO_PS -weo 'rss comm'" 571 ac_cv_rss_command="$PATH_TO_PS -weo 'rss comm'"
568 ac_cv_rss_format="%d %s" 572 ac_cv_rss_format="%d %s"
569 EXTRAS="$EXTRAS check_nagios" 573 EXTRAS="$EXTRAS check_nagios"
570 echo " ps syntax... $PATH_TO_PS -weo 'stat comm vsz rss user ppid args'" 574 AC_MSG_RESULT([$ac_cv_ps_command])
571 575
572dnl FreeBSD 576dnl FreeBSD
573elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | \ 577elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | \
@@ -583,7 +587,7 @@ then
583 ac_cv_rss_command="$PATH_TO_PS waxco 'rss command'" 587 ac_cv_rss_command="$PATH_TO_PS waxco 'rss command'"
584 ac_cv_rss_format="%d %s" 588 ac_cv_rss_format="%d %s"
585 EXTRAS="$EXTRAS check_nagios" 589 EXTRAS="$EXTRAS check_nagios"
586 echo " ps syntax... $PATH_TO_PS -Ao 'state command vsz rss'" 590 AC_MSG_RESULT([$ac_cv_ps_command])
587 591
588dnl BSD-like mode in RH 6.1 592dnl BSD-like mode in RH 6.1
589elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \ 593elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \
@@ -600,7 +604,7 @@ then
600 ac_cv_rss_command="$PATH_TO_PS waxno 'rss comm'" 604 ac_cv_rss_command="$PATH_TO_PS waxno 'rss comm'"
601 ac_cv_rss_format="%d %s" 605 ac_cv_rss_format="%d %s"
602 EXTRAS="$EXTRAS check_nagios" 606 EXTRAS="$EXTRAS check_nagios"
603 echo " ps syntax... $PATH_TO_PS -waxco 'state comm vsz rss'" 607 AC_MSG_RESULT([$ac_cv_ps_command])
604 608
605dnl SunOS 4.1.3: 609dnl SunOS 4.1.3:
606dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND 610dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
@@ -618,7 +622,7 @@ then
618 ac_cv_rss_command="$PATH_TO_PS laxnwww" 622 ac_cv_rss_command="$PATH_TO_PS laxnwww"
619 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %d" 623 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %d"
620 EXTRAS="$EXTRAS check_nagios" 624 EXTRAS="$EXTRAS check_nagios"
621 echo " ps syntax... $PATH_TO_PS laxnwww" 625 AC_MSG_RESULT([$ac_cv_ps_command])
622 626
623dnl Debian Linux / procps v1.2.9: 627dnl Debian Linux / procps v1.2.9:
624dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND 628dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
@@ -637,7 +641,7 @@ then
637 ac_cv_rss_command="$PATH_TO_PS laxnwww" 641 ac_cv_rss_command="$PATH_TO_PS laxnwww"
638 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %d" 642 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %d"
639 EXTRAS="$EXTRAS check_nagios" 643 EXTRAS="$EXTRAS check_nagios"
640 echo " ps syntax... $PATH_TO_PS laxnwww" 644 AC_MSG_RESULT([$ac_cv_ps_command])
641 645
642dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs) 646dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
643elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \ 647elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
@@ -654,7 +658,7 @@ then
654 ac_cv_rss_command="$PATH_TO_PS -axo 'rss comm'" 658 ac_cv_rss_command="$PATH_TO_PS -axo 'rss comm'"
655 ac_cv_rss_format="%d %s" 659 ac_cv_rss_format="%d %s"
656 EXTRAS="$EXTRAS check_nagios" 660 EXTRAS="$EXTRAS check_nagios"
657 echo " ps syntax... $PATH_TO_PS -axo 'stat comm vsz rss user ppid args'" 661 AC_MSG_RESULT([$ac_cv_ps_command])
658 662
659dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT 663dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT
660elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \ 664elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
@@ -671,7 +675,7 @@ then
671 ac_cv_rss_command="$PATH_TO_PS -ao 'rss comm'" 675 ac_cv_rss_command="$PATH_TO_PS -ao 'rss comm'"
672 ac_cv_rss_format="%d %s" 676 ac_cv_rss_format="%d %s"
673 EXTRAS="$EXTRAS check_nagios" 677 EXTRAS="$EXTRAS check_nagios"
674 echo " ps syntax... $PATH_TO_PS -ao 'stat comm vsz rss user ppid args'" 678 AC_MSG_RESULT([$ac_cv_ps_command])
675 679
676elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \ 680elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \
677 egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ \ 681 egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ \
@@ -687,7 +691,7 @@ then
687 ac_cv_rss_command="$PATH_TO_PS -eo 'rss comm'" 691 ac_cv_rss_command="$PATH_TO_PS -eo 'rss comm'"
688 ac_cv_rss_format="%d %s" 692 ac_cv_rss_format="%d %s"
689 EXTRAS="$EXTRAS check_nagios" 693 EXTRAS="$EXTRAS check_nagios"
690 echo " ps syntax... $PATH_TO_PS -eo 's comm vsz rss user ppid args'" 694 AC_MSG_RESULT([$ac_cv_ps_command])
691 695
692elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \ 696elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \
693 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ 697 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \
@@ -703,7 +707,7 @@ then
703 ac_cv_rss_command="$PATH_TO_PS -Ao 'rss comm'" 707 ac_cv_rss_command="$PATH_TO_PS -Ao 'rss comm'"
704 ac_cv_rss_format="%d %s" 708 ac_cv_rss_format="%d %s"
705 EXTRAS="$EXTRAS check_nagios" 709 EXTRAS="$EXTRAS check_nagios"
706 echo " ps syntax... $PATH_TO_PS -Ao 's comm vsz rss'" 710 AC_MSG_RESULT([$ac_cv_ps_command])
707 711
708elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \ 712elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \
709 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ 713 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \
@@ -719,7 +723,7 @@ then
719 ac_cv_rss_command="$PATH_TO_PS -Ao 'rss comm'" 723 ac_cv_rss_command="$PATH_TO_PS -Ao 'rss comm'"
720 ac_cv_rss_format="%d %s" 724 ac_cv_rss_format="%d %s"
721 EXTRAS="$EXTRAS check_nagios" 725 EXTRAS="$EXTRAS check_nagios"
722 echo " ps syntax... $PATH_TO_PS -Ao 'status comm vsz rss'" 726 AC_MSG_RESULT([$ac_cv_ps_command])
723 727
724elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \ 728elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \
725 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \ 729 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER \
@@ -735,7 +739,7 @@ then
735 ac_cv_rss_command="$PATH_TO_PS -Ao 'rss comm'" 739 ac_cv_rss_command="$PATH_TO_PS -Ao 'rss comm'"
736 ac_cv_rss_format="%d %s" 740 ac_cv_rss_format="%d %s"
737 EXTRAS="$EXTRAS check_nagios" 741 EXTRAS="$EXTRAS check_nagios"
738 echo " ps syntax... $PATH_TO_PS -Ao 'state comm vsz rss'" 742 AC_MSG_RESULT([$ac_cv_ps_command])
739 743
740dnl wonder who takes state instead of stat 744dnl wonder who takes state instead of stat
741elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \ 745elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \
@@ -752,7 +756,7 @@ then
752 ac_cv_rss_command="$PATH_TO_PS -ao 'rss command'" 756 ac_cv_rss_command="$PATH_TO_PS -ao 'rss command'"
753 ac_cv_rss_format="%d %s" 757 ac_cv_rss_format="%d %s"
754 EXTRAS="$EXTRAS check_nagios" 758 EXTRAS="$EXTRAS check_nagios"
755 echo " ps syntax... $PATH_TO_PS -ao 'state command vsz rss'" 759 AC_MSG_RESULT([$ac_cv_ps_command])
756 760
757dnl IRIX 53 761dnl IRIX 53
758elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \ 762elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \
@@ -766,7 +770,7 @@ then
766 ac_cv_vsz_format="%*s %*s %*s %*s %d" 770 ac_cv_vsz_format="%*s %*s %*s %*s %d"
767 ac_cv_rss_command="$PATH_TO_PS -el" 771 ac_cv_rss_command="$PATH_TO_PS -el"
768 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d" 772 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d"
769 echo " ps syntax... $PATH_TO_PS -el" 773 AC_MSG_RESULT([$ac_cv_ps_command])
770 774
771dnl IRIX 63 775dnl IRIX 63
772elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \ 776elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI \
@@ -780,7 +784,7 @@ then
780 ac_cv_vsz_format="%*s %*s %*s %*s %d" 784 ac_cv_vsz_format="%*s %*s %*s %*s %d"
781 ac_cv_rss_command="$PATH_TO_PS -el" 785 ac_cv_rss_command="$PATH_TO_PS -el"
782 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d" 786 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d"
783 echo " ps syntax... $PATH_TO_PS -el" 787 AC_MSG_RESULT([$ac_cv_ps_command])
784 788
785dnl AIX 4.1: 789dnl AIX 4.1:
786dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD 790dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
@@ -796,7 +800,7 @@ then
796 ac_cv_vsz_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %d" 800 ac_cv_vsz_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %d"
797 ac_cv_rss_command="$PATH_TO_PS -el" 801 ac_cv_rss_command="$PATH_TO_PS -el"
798 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %d" 802 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %*s %*s %d"
799 echo " ps syntax... $PATH_TO_PS -el" 803 AC_MSG_RESULT([$ac_cv_ps_command])
800 804
801dnl AIX? 805dnl AIX?
802elif ps glaxen 2>/dev/null | egrep -i ["^ *F +UID +PID +PPID +PRI +NI \ 806elif ps glaxen 2>/dev/null | egrep -i ["^ *F +UID +PID +PPID +PRI +NI \
@@ -810,7 +814,7 @@ then
810 ac_cv_vsz_format="%*s %*s %*s %*s %*s %*s %d" 814 ac_cv_vsz_format="%*s %*s %*s %*s %*s %*s %d"
811 ac_cv_rss_command="$PATH_TO_PS glaxen" 815 ac_cv_rss_command="$PATH_TO_PS glaxen"
812 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %d" 816 ac_cv_rss_format="%*s %*s %*s %*s %*s %*s %*s %d"
813 echo " ps syntax... $PATH_TO_PS glaxen" 817 AC_MSG_RESULT([$ac_cv_ps_command])
814 818
815dnl MacOSX / Darwin 819dnl MacOSX / Darwin
816dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT 820dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
@@ -829,7 +833,7 @@ then
829 ac_cv_rss_command="$PATH_TO_PS waxco 'rss command'" 833 ac_cv_rss_command="$PATH_TO_PS waxco 'rss command'"
830 ac_cv_rss_format="%d %s" 834 ac_cv_rss_format="%d %s"
831 EXTRAS="$EXTRAS check_nagios" 835 EXTRAS="$EXTRAS check_nagios"
832 echo " ps syntax... $PATH_TO_PS waxo 'state vsz rss command'" 836 AC_MSG_RESULT([$ac_cv_ps_command])
833 837
834dnl UnixWare 838dnl UnixWare
835elif ps -Al 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI \ 839elif ps -Al 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI \
@@ -845,7 +849,7 @@ then
845 ac_cv_vsz_command="$PATH_TO_PS -Ao 'vsz comm'" 849 ac_cv_vsz_command="$PATH_TO_PS -Ao 'vsz comm'"
846 ac_cv_vsz_format="%*s %d" 850 ac_cv_vsz_format="%*s %d"
847 fi 851 fi
848 echo " ps syntax... $PATH_TO_PS -Al" 852 AC_MSG_RESULT([$ac_cv_ps_command])
849 853
850else 854else
851 AC_MSG_WARN([unable to find usable ps syntax]) 855 AC_MSG_WARN([unable to find usable ps syntax])
@@ -857,57 +861,60 @@ then
857fi 861fi
858AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist, 862AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
859 [Variable list for sscanf of 'ps' output]) 863 [Variable list for sscanf of 'ps' output])
860AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,$ac_cv_ps_raw_command, 864AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$ac_cv_ps_raw_command",
861 [Verbatim command to execute for ps in check_netsaint]) 865 [Verbatim command to execute for ps in check_netsaint])
862AC_DEFINE_UNQUOTED(PS_COMMAND,$ac_cv_ps_command, 866AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
863 [Verbatim command to execute for ps in check_procs]) 867 [Verbatim command to execute for ps in check_procs])
864AC_DEFINE_UNQUOTED(PS_FORMAT,$ac_cv_ps_format, 868AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
865 [Format string for scanning ps output in check_procs]) 869 [Format string for scanning ps output in check_procs])
866AC_DEFINE_UNQUOTED(VSZ_COMMAND,$ac_cv_vsz_command, 870AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$ac_cv_vsz_command",
867 [Verbatim command to execute for ps in check_vsz]) 871 [Verbatim command to execute for ps in check_vsz])
868AC_DEFINE_UNQUOTED(VSZ_FORMAT,$ac_cv_vsz_format, 872AC_DEFINE_UNQUOTED(VSZ_FORMAT,"$ac_cv_vsz_format",
869 [Format string for scanning ps output in check_vsz]) 873 [Format string for scanning ps output in check_vsz])
870AC_DEFINE_UNQUOTED(RSS_COMMAND,$ac_cv_rss_command, 874AC_DEFINE_UNQUOTED(RSS_COMMAND,"$ac_cv_rss_command",
871 [Verbatim command to execute for ps in check_rss]) 875 [Verbatim command to execute for ps in check_rss])
872AC_DEFINE_UNQUOTED(RSS_FORMAT,$ac_cv_rss_format, 876AC_DEFINE_UNQUOTED(RSS_FORMAT,"$ac_cv_rss_format",
873 [Format string for scanning ps output in check_rss]) 877 [Format string for scanning ps output in check_rss])
874 878
879AC_PATH_PROG(PATH_TO_DF,df)
880AC_PATH_PROG(PATH_TO_BDF,bdf)
881
875AC_ARG_WITH(df_command, 882AC_ARG_WITH(df_command,
876 ACX_HELP_STRING([--with-df-command=SYNTAX], 883 ACX_HELP_STRING([--with-df-command=SYNTAX],
877 [sets syntax for df]), 884 [sets syntax for df]),
878 DF_COMMAND=$withval,) 885 ac_cv_df_command=$withval,)
879if test -n "$DF_COMMAND" 886
887AC_MSG_CHECKING(for df syntax)
888if test -n "$ac_cv_df_command"
880then 889then
881 AC_DEFINE_UNQUOTED(DF_COMMAND,"$DF_COMMAND",[path and args for df command]) 890 AC_MSG_RESULT([$ac_cv_df_command])
882 891
883elif 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 892elif 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
884then 893then
885 AC_PATH_PROG(PATH_TO_DF,df) 894 ac_cv_df_command="$PATH_TO_DF -Pk"
886 AC_MSG_RESULT([ df syntax... $PATH_TO_DF -Pk]) 895 AC_MSG_RESULT([$ac_cv_df_command])
887 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -Pk",[path and args for df command])
888 896
889elif df -k 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null 897elif df -k 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
890then 898then
891 AC_PATH_PROG(PATH_TO_DF,df) 899 ac_cv_df_command="$PATH_TO_DF -k"
892 AC_MSG_RESULT([ df syntax... $PATH_TO_DF -k]) 900 AC_MSG_RESULT([$ac_cv_df_command])
893 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -k",[path and args for df command])
894 901
895elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null 902elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
896then 903then
897 AC_PATH_PROG(PATH_TO_DF,df) 904 ac_cv_df_command="$PATH_TO_DF"
898 AC_MSG_RESULT([ df syntax... $PATH_TO_DF]) 905 AC_MSG_RESULT([$ac_cv_df_command])
899 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command])
900 906
901elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null 907elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null
902then 908then
903 AC_PATH_PROG(PATH_TO_DF,bdf) 909 ac_cv_df_command="$PATH_TO_BDF"
904 AC_MSG_RESULT([ df syntax... $PATH_TO_DF]) 910 AC_MSG_RESULT([$ac_cv_df_command])
905 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command])
906 911
907else 912else
908 AC_MSG_WARN([unable to find usable df syntax]) 913 AC_MSG_WARN([unable to find usable df syntax])
909fi 914fi
910 915
916AC_DEFINE_UNQUOTED(DF_COMMAND,"$ac_cv_df_command",[path and args for df command])
917
911AC_PATH_PROG(PATH_TO_PING,ping) 918AC_PATH_PROG(PATH_TO_PING,ping)
912AC_PATH_PROG(PATH_TO_PING6,ping6) 919AC_PATH_PROG(PATH_TO_PING6,ping6)
913 920
@@ -916,13 +923,15 @@ AC_ARG_WITH(ping_command,
916 [sets syntax for ICMP ping]), 923 [sets syntax for ICMP ping]),
917 ac_cv_ping_command=$withval,) 924 ac_cv_ping_command=$withval,)
918 925
926AC_MSG_CHECKING(for ping syntax)
919if test -n "$ac_cv_ping_command" 927if test -n "$ac_cv_ping_command"
920then 928then
921 echo " ping syntax... (command-line) $ac_cv_ping_command" 929 AC_MSG_RESULT([(command-line) $ac_cv_ping_command])
922 if test -n "$PING_PACKETS_FIRST" 930 if test -n "$PING_PACKETS_FIRST"
923 then 931 then
924 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", 932 ac_cv_ping_packets_first=yes
925 [Define if packet count must precede host]) 933 dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command",
934 dnl [Define if packet count must precede host])
926 fi 935 fi
927 936
928elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \ 937elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
@@ -930,65 +939,60 @@ elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
930 egrep -i "^round-trip|^rtt" >/dev/null 939 egrep -i "^round-trip|^rtt" >/dev/null
931then 940then
932 ac_cv_ping_command="$PATH_TO_PING -n -U -c %d %s" 941 ac_cv_ping_command="$PATH_TO_PING -n -U -c %d %s"
933 dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", 942 ac_cv_ping_packets_first=yes
934 dnl [Define if packet count must precede host]) 943 AC_MSG_RESULT([$ac_cv_ping_command])
935 echo " ping syntax... ping -n -U -c <count> <host>"
936 944
937elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \ 945elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
938 egrep -i "^round-trip|^rtt" >/dev/null 946 egrep -i "^round-trip|^rtt" >/dev/null
939then 947then
940 ac_cv_ping_command="$PATH_TO_PING -n -U -c %d %s" 948 ac_cv_ping_command="$PATH_TO_PING -n -U -c %d %s"
941 dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", 949 ac_cv_ping_packets_first=yes
942 dnl [Define if packet count must precede host]) 950 AC_MSG_RESULT([$ac_cv_ping_command])
943 echo " ping syntax... ping -n -U -c <count> <host>"
944 951
945elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \ 952elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
946 egrep -i "^round-trip|^rtt" >/dev/null 953 egrep -i "^round-trip|^rtt" >/dev/null
947then 954then
948 ac_cv_ping_command="$PATH_TO_PING -n -c %d %s" 955 ac_cv_ping_command="$PATH_TO_PING -n -c %d %s"
949 dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", 956 ac_cv_ping_packets_first=yes
950 dnl [Define if packet count must precede host]) 957 AC_MSG_RESULT([$ac_cv_ping_command])
951 echo " ping syntax... $PATH_TO_PING -n -c <count> <host>"
952 958
953elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \ 959elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
954 egrep -i "^round-trip|^rtt" >/dev/null 960 egrep -i "^round-trip|^rtt" >/dev/null
955then 961then
956 ac_cv_ping_command="$PATH_TO_PING -n %s -c %d" 962 ac_cv_ping_command="$PATH_TO_PING -n %s -c %d"
957 echo " ping syntax... $PATH_TO_PING -n <host> -c <count>" 963 AC_MSG_RESULT([$ac_cv_ping_command])
958 964
959elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \ 965elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
960 egrep -i "^round-trip|^rtt" >/dev/null 966 egrep -i "^round-trip|^rtt" >/dev/null
961then 967then
962 ac_cv_ping_command="$PATH_TO_PING %s -n %d" 968 ac_cv_ping_command="$PATH_TO_PING %s -n %d"
963 echo " ping syntax... $PATH_TO_PING <host> -n <count>" 969 AC_MSG_RESULT([$ac_cv_ping_command])
964 970
965elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \ 971elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
966 egrep -i "^round-trip|^rtt" >/dev/null 972 egrep -i "^round-trip|^rtt" >/dev/null
967then 973then
968 ac_cv_ping_command="$PATH_TO_PING -n -s %s 56 %d" 974 ac_cv_ping_command="$PATH_TO_PING -n -s %s 56 %d"
969 echo " ping syntax... $PATH_TO_PING -n -s <host> 56 <count>" 975 AC_MSG_RESULT([$ac_cv_ping_command])
970 976
971elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \ 977elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
972 egrep -i "^round-trip|^rtt" >/dev/null 978 egrep -i "^round-trip|^rtt" >/dev/null
973then 979then
974 ac_cv_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d" 980 ac_cv_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
975 echo " ping syntax... $PATH_TO_PING -n -h <host> -s 56 -c <count>" 981 AC_MSG_RESULT([$ac_cv_ping_command])
976 982
977elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \ 983elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
978 egrep -i "^round-trip|^rtt" >/dev/null 984 egrep -i "^round-trip|^rtt" >/dev/null
979then 985then
980 ac_cv_ping_command="$PATH_TO_PING -n -s 56 -c %d %s" 986 ac_cv_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
981 dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", 987 ac_cv_ping_packets_first=yes
982 dnl [Define if packet count must precede host]) 988 AC_MSG_RESULT([$ac_cv_ping_command])
983 echo " ping syntax... $PATH_TO_PING -n -s 56 -c <count> <host>"
984 989
985elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \ 990elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
986 egrep -i "^round-trip|^rtt" >/dev/null 991 egrep -i "^round-trip|^rtt" >/dev/null
987then 992then
988 ac_cv_ping_command="$PATH_TO_PING -n -c %d %s" 993 ac_cv_ping_command="$PATH_TO_PING -n -c %d %s"
989 dnl AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$ac_cv_ping_command", 994 ac_cv_ping_packets_first=yes
990 dnl [Define if packet count must precede host]) 995 AC_MSG_RESULT([$ac_cv_ping_command])
991 echo " ping syntax... $PATH_TO_PING -n -c <count> <host>"
992 996
993else 997else
994 AC_MSG_WARN([unable to find usable ping syntax]) 998 AC_MSG_WARN([unable to find usable ping syntax])
@@ -997,27 +1001,41 @@ fi
997AC_DEFINE_UNQUOTED(PING_COMMAND,"$ac_cv_ping_command", 1001AC_DEFINE_UNQUOTED(PING_COMMAND,"$ac_cv_ping_command",
998 [path and args for ICMP ping command]) 1002 [path and args for ICMP ping command])
999 1003
1004if test x$ac_cv_ping_packets_first != xno
1005then
1006 AC_DEFINE(PING_PACKETS_FIRST,1,
1007 [Define if packet count must precede host])
1008fi
1009
1000AC_ARG_WITH(ping6_command, 1010AC_ARG_WITH(ping6_command,
1001 ACX_HELP_STRING([--with-ping6-command=SYNTAX], 1011 ACX_HELP_STRING([--with-ping6-command=SYNTAX],
1002 [sets syntax for ICMPv6 ping]), 1012 [sets syntax for ICMPv6 ping]),
1003 PING6_COMMAND=$withval,) 1013 PING6_COMMAND=$withval,)
1004 1014
1005AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup) 1015AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1006if test -n "$ac_cv_path_PATH_TO_NSLOOKUP" 1016
1017AC_MSG_CHECKING(for nslookup syntax)
1018if test -n "$PATH_TO_NSLOOKUP"
1007then 1019then
1008 if nslookup -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null 1020 if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1009 then 1021 then
1010 AC_MSG_RESULT([ nslookup syntax... $PATH_TO_NSLOOKUP]) 1022 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1011 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP",[path and args for nslookup]) 1023 AC_MSG_RESULT([$ac_cv_nslookup_command])
1024
1012 else 1025 else
1013 AC_MSG_RESULT([ nslookup syntax... $PATH_TO_NSLOOKUP -sil]) 1026 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1014 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP -sil",[path and args for nslookup]) 1027 AC_MSG_RESULT([$ac_cv_nslookup_command])
1028
1015 fi 1029 fi
1016 EXTRAS="$EXTRAS check_dns" 1030 EXTRAS="$EXTRAS check_dns"
1031
1017else 1032else
1018 AC_MSG_WARN([nslookup command not found]) 1033 AC_MSG_WARN([nslookup command not found])
1019fi 1034fi
1020 1035
1036AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command",
1037 [path and args for nslookup])
1038
1021AC_PATH_PROG(PATH_TO_HOST,host) 1039AC_PATH_PROG(PATH_TO_HOST,host)
1022if test -n "$ac_cv_path_PATH_TO_HOST" 1040if test -n "$ac_cv_path_PATH_TO_HOST"
1023then 1041then
@@ -1030,7 +1048,6 @@ AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1030AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo) 1048AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1031AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary]) 1049AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1032 1050
1033M
1034AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate) 1051AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
1035AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc) 1052AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
1036AC_PATH_PROGS(PATH_TO_NTPQ,ntpq) 1053AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
@@ -1039,7 +1056,6 @@ then
1039 AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary]) 1056 AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
1040 AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary]) 1057 AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
1041else 1058else
1042 dnl echo "** Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization"
1043 AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization]) 1059 AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
1044fi 1060fi
1045 1061
@@ -1048,7 +1064,6 @@ if test -x "$PATH_TO_LMSTAT"
1048then 1064then
1049 AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat]) 1065 AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1050else 1066else
1051 dnl echo "** Get lmstat from Globetrotter Software to monitor flexlm licenses"
1052 AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses]) 1067 AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1053fi 1068fi
1054 1069
@@ -1057,26 +1072,28 @@ if test -x "$PATH_TO_SMBCLIENT"
1057then 1072then
1058 AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary]) 1073 AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1059else 1074else
1060 dnl echo "** Get smbclient from Samba.org to monitor SMB shares"
1061 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) 1075 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1062fi 1076fi
1063 1077
1064 1078
1065AC_PATH_PROG(PATH_TO_WHO,who) 1079AC_PATH_PROG(PATH_TO_WHO,who)
1066if [who -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] 1080
1081if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1067then 1082then
1068 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO -q",[path and arguments for invoking 'who']) 1083 ac_cv_path_to_who="$PATH_TO_WHO -q"
1069else 1084else
1070 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO",[path and arguments for invoking 'who']) 1085 ac_cv_path_to_who="$PATH_TO_WHO"
1071fi 1086fi
1072 1087
1088AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1089 [path and arguments for invoking 'who'])
1090
1073AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) 1091AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1074if test -x "$PATH_TO_SNMPGET" 1092if test -x "$PATH_TO_SNMPGET"
1075then 1093then
1076 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary]) 1094 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1077 EXTRAS="$EXTRAS check_hpjd check_snmp" 1095 EXTRAS="$EXTRAS check_hpjd check_snmp"
1078else 1096else
1079 dnl echo "** Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins"
1080 AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins]) 1097 AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1081fi 1098fi
1082 1099
@@ -1088,45 +1105,50 @@ fi
1088 1105
1089if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null ) 1106if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
1090then 1107then
1091 echo "Found Net::SNMP perl module" 1108 AC_MSG_CHECKING(for Net::SNMP perl module)
1109 AC_MSG_RESULT([found])
1092else 1110else
1093 dnl echo "** Tried $PERL - install Net::SNMP perl module if you want to"
1094 dnl echo " use the perl snmp plugins"
1095 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins]) 1111 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1096fi 1112fi
1097 1113
1098AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) 1114AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1099AC_PATH_PROG(PATH_TO_QSTAT,qstat) 1115AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1116
1100if test -x "$PATH_TO_QUAKESTAT" 1117if test -x "$PATH_TO_QUAKESTAT"
1101then 1118then
1102 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$PATH_TO_QUAKESTAT",[path to qstat/quakestat]) 1119 ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1103 EXTRAS="$EXTRAS check_game" 1120 EXTRAS="$EXTRAS check_game"
1121
1104elif test -x "$PATH_TO_QSTAT" 1122elif test -x "$PATH_TO_QSTAT"
1105then 1123then
1106 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$PATH_TO_QSTAT",[path to qstat/quakestat]) 1124 ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1107 EXTRAS="$EXTRAS check_game" 1125 EXTRAS="$EXTRAS check_game"
1108else 1126else
1109 dnl echo "** Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin"
1110 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin]) 1127 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1111fi 1128fi
1112 1129
1130if test x$ac_cv_path_to_qstat != x
1131then
1132 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1133 [path to qstat/quakestat])
1134fi
1135
1113AC_PATH_PROG(PATH_TO_FPING,fping) 1136AC_PATH_PROG(PATH_TO_FPING,fping)
1114if test -x "$PATH_TO_FPING" 1137if test -x "$PATH_TO_FPING"
1115then 1138then
1116 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) 1139 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1117 EXTRAS="$EXTRAS check_fping" 1140 EXTRAS="$EXTRAS check_fping"
1118else 1141else
1119 dnl echo "** Get fping from http://www.fping.com in order to make check_fping plugin"
1120 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) 1142 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1121fi 1143fi
1122 1144
1123AC_PATH_PROG(PATH_TO_SSH,ssh) 1145AC_PATH_PROG(PATH_TO_SSH,ssh)
1146
1124if test -x "$PATH_TO_SSH" 1147if test -x "$PATH_TO_SSH"
1125then 1148then
1126 AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary]) 1149 AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1127 EXTRAS="$EXTRAS check_by_ssh" 1150 EXTRAS="$EXTRAS check_by_ssh"
1128else 1151else
1129 dnl echo "** Get ssh in order to make check_by_ssh plugin"
1130 AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin]) 1152 AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1131fi 1153fi
1132 1154
@@ -1136,7 +1158,6 @@ if test -x "$PATH_TO_MAILQ"
1136then 1158then
1137 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq]) 1159 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1138else 1160else
1139 dnl echo "** Could not find mailq or eqivalent"
1140 AC_MSG_WARN([Could not find mailq or eqivalent]) 1161 AC_MSG_WARN([Could not find mailq or eqivalent])
1141fi 1162fi
1142 1163
@@ -1148,51 +1169,74 @@ dnl dunno why this does not work below - use hack (kbd)
1148dnl fine on linux, broken on solaris 1169dnl fine on linux, broken on solaris
1149dnl if /bin/test -e "/proc/meminfo" 1170dnl if /bin/test -e "/proc/meminfo"
1150 1171
1172AC_PATH_PROG(PATH_TO_SWAP,swap)
1173AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1174
1175AC_MSG_CHECKING(for how to check memory)
1151if [cat /proc/meminfo > /dev/null 2>&1] 1176if [cat /proc/meminfo > /dev/null 2>&1]
1152then 1177then
1153 echo "found /proc/meminfo" 1178 AC_MSG_RESULT([found /proc/meminfo])
1154 AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo]) 1179 AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1155 AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo",[path to /proc/meminfo if name changes]) 1180 AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo",[path to /proc/meminfo if name changes])
1156 EXTRAS="$EXTRAS check_swap" 1181 EXTRAS="$EXTRAS check_swap"
1157elif [swap -l 2>&1 >/dev/null] 1182
1183elif [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1158then 1184then
1159 echo "found swap command" 1185 ac_cv_have_swap=yes
1160 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found]) 1186 ac_cv_swap_command="$PATH_TO_SWAP -l"
1161 AC_PATH_PROG(PATH_TO_SWAP,swap) 1187 if [$PATH_TO_SWAP -l 2>/dev/null | \
1162 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -l",[Path to swap/swapinfo binary, with any args]) 1188 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1163 if [swap -l 2>/dev/null | egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" >/dev/null] 1189 >/dev/null]
1164 then 1190 then
1165 AC_DEFINE_UNQUOTED(SWAP_FORMAT,[" %*d %*s %*d,%*d %*d %*d %d %d"],[Format string for parsing swap output]) 1191 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %d %d"]
1166 echo " using IRIX format" 1192 AC_MSG_RESULT([using IRIX format swap])
1167 elif [swap -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null] 1193
1194 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
1168 then 1195 then
1169 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"],[Format string for parsing swap output]) 1196 ac_cv_swap_format=["%*s %*[[0-9,-]] %*d %d %d"]
1170 echo " using Solaris format" 1197 AC_MSG_RESULT([using Solaris format swap])
1171 elif [swap -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null] 1198
1199 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1172 then 1200 then
1173 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"],[Format string for parsing swap output]) 1201 ac_cv_swap_format=["%*s %*[[0-9,-]] %*d %d %d"]
1174 echo " using Unixware format" 1202 AC_MSG_RESULT([using Unixware format swap])
1203
1175 fi 1204 fi
1176 EXTRAS="$EXTRAS check_swap" 1205 EXTRAS="$EXTRAS check_swap"
1177elif [swapinfo -k 2>&1 | egrep -i "^Device" >/dev/null] 1206
1207elif [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1178then 1208then
1179 echo "found swapinfo command" 1209 ac_cv_have_swap=yes
1180 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found]) 1210 ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1181 AC_PATH_PROG(PATH_TO_SWAP,swapinfo) 1211
1182 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -k",[Path to swap/swapinfo binary, with any args]) 1212 if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1183 if [swapinfo -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1184 then 1213 then
1185 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"],[Format string for parsing swap output]) 1214 ac_cv_swap_format=["%*s %d %*d %d"]
1186 echo " using FreeBSD format" 1215 AC_MSG_RESULT([using FreeBSD format swapinfo])
1187 fi 1216 fi
1188 EXTRAS="$EXTRAS check_swap" 1217 EXTRAS="$EXTRAS check_swap"
1189elif [swapinfo -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null] 1218
1219elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1220then
1221 ac_cv_have_swap=yes
1222 ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
1223 ac_cv_swap_format=["%*s %d %*d %d"]
1224 AC_MSG_RESULT([using HP-UX format swapinfo])
1225fi
1226
1227if test x$ac_cv_have_swap != x
1190then 1228then
1191 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found]) 1229 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1192 AC_PATH_PROG(PATH_TO_SWAP,swapinfo) 1230fi
1193 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -dfM",[Path to swap/swapinfo binary, with any args]) 1231if test x$ac_cv_swap_format != x
1194 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"],[Format string for parsing swap output ]) 1232then
1195 echo " using HP-UX format HP-UX" 1233 AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1234 [Format string for parsing swap output])
1235fi
1236if test x$ac_cv_swap_command != x
1237then
1238 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1239 [Path to swap/swapinfo binary, with any args])
1196fi 1240fi
1197 1241
1198AC_PATH_PROG(PATH_TO_DIG,dig) 1242AC_PATH_PROG(PATH_TO_DIG,dig)
@@ -1207,18 +1251,19 @@ elif test -f ../plugins/check_nt.c ; then
1207 EXTRAS="$EXTRAS check_nt" 1251 EXTRAS="$EXTRAS check_nt"
1208fi 1252fi
1209 1253
1254AC_MSG_CHECKING(for va_list)
1210AC_TRY_COMPILE([#ifdef __STDC__ 1255AC_TRY_COMPILE([#ifdef __STDC__
1211#include <stdio.h> 1256 #include <stdio.h>
1212#include <stdlib.h> 1257 #include <stdlib.h>
1213#include <stdarg.h> 1258 #include <stdarg.h>
1214#else 1259 #else
1215#include <sys/types.h> 1260 #include <sys/types.h>
1216#include <stdio.h> 1261 #include <stdio.h>
1217#include <varargs.h> 1262 #include <varargs.h>
1218#endif], 1263 #endif],
1219[va_list args;], 1264 [va_list args;],
1220[AC_MSG_RESULT(yes)], 1265 [AC_MSG_RESULT(yes)],
1221[NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)]) 1266 [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
1222 1267
1223AC_SUBST(EXTRAS) 1268AC_SUBST(EXTRAS)
1224AC_SUBST(DEPLIBS) 1269AC_SUBST(DEPLIBS)