diff options
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 63 | 
1 files changed, 61 insertions, 2 deletions
| diff --git a/configure.ac b/configure.ac index bf129956..dfc37b5e 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. | 
| 2 | AC_PREREQ(2.59) | 2 | AC_PREREQ(2.59) | 
| 3 | AC_INIT(monitoring-plugins,2.2) | 3 | AC_INIT(monitoring-plugins,2.3git) | 
| 4 | AC_CONFIG_SRCDIR(NPTest.pm) | 4 | AC_CONFIG_SRCDIR(NPTest.pm) | 
| 5 | AC_CONFIG_FILES([gl/Makefile]) | 5 | AC_CONFIG_FILES([gl/Makefile]) | 
| 6 | AC_CONFIG_AUX_DIR(build-aux) | 6 | AC_CONFIG_AUX_DIR(build-aux) | 
| @@ -385,6 +385,42 @@ if test "$ac_cv_header_wtsapi32_h" = "yes"; then | |||
| 385 | AC_SUBST(WTSAPI32LIBS) | 385 | AC_SUBST(WTSAPI32LIBS) | 
| 386 | fi | 386 | fi | 
| 387 | 387 | ||
| 388 | _can_enable_check_curl=no | ||
| 389 | dnl Check for cURL library | ||
| 390 | LIBCURL_CHECK_CONFIG(yes, 7.15.2, [ | ||
| 391 | _can_enable_check_curl=yes | ||
| 392 | LIBCURLINCLUDE="$LIBCURL_CPPFLAGS" | ||
| 393 | LIBCURLLIBS="$LIBCURL" | ||
| 394 | LIBCURLCFLAGS="$LIBCURL_CPPFLAGS" | ||
| 395 | AC_SUBST(LIBCURLINCLUDE) | ||
| 396 | AC_SUBST(LIBCURLLIBS) | ||
| 397 | AC_SUBST(LIBCURLCFLAGS) | ||
| 398 | ], [ | ||
| 399 | _can_enable_check_curl=no | ||
| 400 | AC_MSG_WARN([Skipping curl plugin]) | ||
| 401 | AC_MSG_WARN([install libcurl libs to compile this plugin (see REQUIREMENTS).]) | ||
| 402 | ]) | ||
| 403 | |||
| 404 | dnl Check for uriparser library | ||
| 405 | URIPARSER_CHECK(yes, 0.7.5, [ | ||
| 406 | URIPARSERINCLUDE="$URIPARSER_CPPFLAGS" | ||
| 407 | URIPARSERLIBS="$URIPARSER" | ||
| 408 | URIPARSERCFLAGS="$URIPARSER_CPPFLAGS" | ||
| 409 | AC_SUBST(URIPARSERINCLUDE) | ||
| 410 | AC_SUBST(URIPARSERLIBS) | ||
| 411 | AC_SUBST(URIPARSERCFLAGS) | ||
| 412 | ], [ | ||
| 413 | _can_enable_check_curl=no | ||
| 414 | AC_MSG_WARN([Skipping curl plugin]) | ||
| 415 | AC_MSG_WARN([install the uriparser library to compile this plugin (see REQUIREMENTS).]) | ||
| 416 | ]) | ||
| 417 | |||
| 418 | dnl prerequisites met, enable the plugin | ||
| 419 | if test x$_can_enable_check_curl = xyes; then | ||
| 420 | EXTRAS="$EXTRAS check_curl\$(EXEEXT)" | ||
| 421 | fi | ||
| 422 | AC_CONFIG_FILES([plugins/picohttpparser/Makefile]) | ||
| 423 | |||
| 388 | dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface | 424 | dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface | 
| 389 | if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no" | 425 | if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no" | 
| 390 | then | 426 | then | 
| @@ -747,6 +783,16 @@ dnl ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT | |||
| 747 | dnl ac_cv_ps_cols=8 | 783 | dnl ac_cv_ps_cols=8 | 
| 748 | dnl AC_MSG_RESULT([$ac_cv_ps_command]) | 784 | dnl AC_MSG_RESULT([$ac_cv_ps_command]) | 
| 749 | 785 | ||
| 786 | dnl This one is the exact same test as the next one but includes etime | ||
| 787 | elif ps axwo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \ | ||
| 788 | egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +ELAPSED +COMMAND"] > /dev/null | ||
| 789 | then | ||
| 790 | ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]" | ||
| 791 | ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu etime comm args'" | ||
| 792 | ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n" | ||
| 793 | ac_cv_ps_cols=10 | ||
| 794 | AC_MSG_RESULT([$ac_cv_ps_command]) | ||
| 795 | |||
| 750 | dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo. | 796 | dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo. | 
| 751 | dnl so test for this first... | 797 | dnl so test for this first... | 
| 752 | elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \ | 798 | elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \ | 
| @@ -1016,6 +1062,10 @@ if test -n "$ac_cv_ps_varlist" ; then | |||
| 1016 | AC_DEFINE(PS_USES_PROCETIME,"yes", | 1062 | AC_DEFINE(PS_USES_PROCETIME,"yes", | 
| 1017 | [Whether the ps utility uses the "procetime" field]) | 1063 | [Whether the ps utility uses the "procetime" field]) | 
| 1018 | fi | 1064 | fi | 
| 1065 | if echo "$ac_cv_ps_varlist" | grep "procpcpu" >/dev/null; then | ||
| 1066 | AC_DEFINE(PS_USES_PROCPCPU,"yes", | ||
| 1067 | [Whether the ps utility uses the "procpcpu" field]) | ||
| 1068 | fi | ||
| 1019 | fi | 1069 | fi | 
| 1020 | 1070 | ||
| 1021 | AC_PATH_PROG(PATH_TO_PING,ping) | 1071 | AC_PATH_PROG(PATH_TO_PING,ping) | 
| @@ -1060,6 +1110,14 @@ then | |||
| 1060 | ac_cv_ping_packets_first=yes | 1110 | ac_cv_ping_packets_first=yes | 
| 1061 | AC_MSG_RESULT([$with_ping_command]) | 1111 | AC_MSG_RESULT([$with_ping_command]) | 
| 1062 | 1112 | ||
| 1113 | elif $PATH_TO_PING -4 -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ | ||
| 1114 | egrep -i "^round-trip|^rtt" >/dev/null | ||
| 1115 | then | ||
| 1116 | # check if -4 is supported - issue #1550 | ||
| 1117 | with_ping_command="$PATH_TO_PING -4 -n -U -w %d -c %d %s" | ||
| 1118 | ac_cv_ping_packets_first=yes | ||
| 1119 | ac_cv_ping_has_timeout=yes | ||
| 1120 | AC_MSG_RESULT([$with_ping_command]) | ||
| 1063 | elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ | 1121 | elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ | 
| 1064 | egrep -i "^round-trip|^rtt" >/dev/null | 1122 | egrep -i "^round-trip|^rtt" >/dev/null | 
| 1065 | then | 1123 | then | 
| @@ -1882,4 +1940,5 @@ ACX_FEATURE([enable],[perl-modules]) | |||
| 1882 | ACX_FEATURE([with],[cgiurl]) | 1940 | ACX_FEATURE([with],[cgiurl]) | 
| 1883 | ACX_FEATURE([with],[trusted-path]) | 1941 | ACX_FEATURE([with],[trusted-path]) | 
| 1884 | ACX_FEATURE([enable],[libtap]) | 1942 | ACX_FEATURE([enable],[libtap]) | 
| 1885 | 1943 | ACX_FEATURE([with],[libcurl]) | |
| 1944 | ACX_FEATURE([with],[uriparser]) | ||
