diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 122 |
1 files changed, 106 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index 92d9ebfb..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.1) | 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) |
@@ -273,26 +273,33 @@ AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plug | |||
273 | dnl Check for radius libraries | 273 | dnl Check for radius libraries |
274 | AS_IF([test "x$with_radius" != "xno"], [ | 274 | AS_IF([test "x$with_radius" != "xno"], [ |
275 | _SAVEDLIBS="$LIBS" | 275 | _SAVEDLIBS="$LIBS" |
276 | AC_CHECK_LIB(freeradius-client,rc_read_config) | 276 | AC_CHECK_LIB(radcli,rc_read_config) |
277 | if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then | 277 | if test "$ac_cv_lib_radcli_rc_read_config" = "yes"; then |
278 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" | 278 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" |
279 | RADIUSLIBS="-lfreeradius-client" | 279 | RADIUSLIBS="-lradcli" |
280 | AC_SUBST(RADIUSLIBS) | 280 | AC_SUBST(RADIUSLIBS) |
281 | else | 281 | else |
282 | AC_CHECK_LIB(radiusclient-ng,rc_read_config) | 282 | AC_CHECK_LIB(freeradius-client,rc_read_config) |
283 | if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then | 283 | if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then |
284 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" | 284 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" |
285 | RADIUSLIBS="-lradiusclient-ng" | 285 | RADIUSLIBS="-lfreeradius-client" |
286 | AC_SUBST(RADIUSLIBS) | 286 | AC_SUBST(RADIUSLIBS) |
287 | else | 287 | else |
288 | AC_CHECK_LIB(radiusclient,rc_read_config) | 288 | AC_CHECK_LIB(radiusclient-ng,rc_read_config) |
289 | if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then | 289 | if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then |
290 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" | 290 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" |
291 | RADIUSLIBS="-lradiusclient" | 291 | RADIUSLIBS="-lradiusclient-ng" |
292 | AC_SUBST(RADIUSLIBS) | 292 | AC_SUBST(RADIUSLIBS) |
293 | else | 293 | else |
294 | AC_MSG_WARN([Skipping radius plugin]) | 294 | AC_CHECK_LIB(radiusclient,rc_read_config) |
295 | AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) | 295 | if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then |
296 | EXTRAS="$EXTRAS check_radius\$(EXEEXT)" | ||
297 | RADIUSLIBS="-lradiusclient" | ||
298 | AC_SUBST(RADIUSLIBS) | ||
299 | else | ||
300 | AC_MSG_WARN([Skipping radius plugin]) | ||
301 | AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) | ||
302 | fi | ||
296 | fi | 303 | fi |
297 | fi | 304 | fi |
298 | fi | 305 | fi |
@@ -378,6 +385,42 @@ if test "$ac_cv_header_wtsapi32_h" = "yes"; then | |||
378 | AC_SUBST(WTSAPI32LIBS) | 385 | AC_SUBST(WTSAPI32LIBS) |
379 | fi | 386 | fi |
380 | 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 | |||
381 | 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 |
382 | 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" |
383 | then | 426 | then |
@@ -493,15 +536,15 @@ if ! test x"$with_openssl" = x"no"; then | |||
493 | dnl Check for crypto lib | 536 | dnl Check for crypto lib |
494 | _SAVEDLIBS="$LIBS" | 537 | _SAVEDLIBS="$LIBS" |
495 | LIBS="-L${with_openssl}/lib" | 538 | LIBS="-L${with_openssl}/lib" |
496 | AC_CHECK_LIB(crypto,CRYPTO_lock) | 539 | AC_CHECK_LIB(crypto,CRYPTO_new_ex_data) |
497 | if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then | 540 | if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then |
498 | dnl Check for SSL lib | 541 | dnl Check for SSL lib |
499 | AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto) | 542 | AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto) |
500 | fi | 543 | fi |
501 | LIBS="$_SAVEDLIBS" | 544 | LIBS="$_SAVEDLIBS" |
502 | 545 | ||
503 | dnl test headers and libs to decide whether check_http should use SSL | 546 | dnl test headers and libs to decide whether check_http should use SSL |
504 | if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then | 547 | if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then |
505 | if test "$ac_cv_lib_ssl_main" = "yes"; then | 548 | if test "$ac_cv_lib_ssl_main" = "yes"; then |
506 | if test "$FOUNDINCLUDE" = "yes"; then | 549 | if test "$FOUNDINCLUDE" = "yes"; then |
507 | FOUNDOPENSSL="yes" | 550 | FOUNDOPENSSL="yes" |
@@ -610,6 +653,7 @@ AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type , | |||
610 | dnl #### Process table test | 653 | dnl #### Process table test |
611 | 654 | ||
612 | AC_PATH_PROG(PATH_TO_PS,ps) | 655 | AC_PATH_PROG(PATH_TO_PS,ps) |
656 | AC_PATH_PROG(PATH_TO_ENV,env) | ||
613 | 657 | ||
614 | AC_MSG_CHECKING(for ps syntax) | 658 | AC_MSG_CHECKING(for ps syntax) |
615 | AC_ARG_WITH(ps_command, | 659 | AC_ARG_WITH(ps_command, |
@@ -739,6 +783,16 @@ dnl ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT | |||
739 | dnl ac_cv_ps_cols=8 | 783 | dnl ac_cv_ps_cols=8 |
740 | dnl AC_MSG_RESULT([$ac_cv_ps_command]) | 784 | dnl AC_MSG_RESULT([$ac_cv_ps_command]) |
741 | 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 | |||
742 | 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. |
743 | dnl so test for this first... | 797 | dnl so test for this first... |
744 | 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 | \ |
@@ -931,6 +985,19 @@ then | |||
931 | ac_cv_ps_cols=6 | 985 | ac_cv_ps_cols=6 |
932 | AC_MSG_RESULT([$ac_cv_ps_command]) | 986 | AC_MSG_RESULT([$ac_cv_ps_command]) |
933 | 987 | ||
988 | dnl HP-UX: | ||
989 | dnl S UID RUID USER RUSER PID PPID VSZ %CPU COMMAND COMMAND | ||
990 | dnl S 0 400 root oracle 2805 1 12904 0.00 ora_dism_SEA1X ora_dism_SEA1X | ||
991 | dnl S 400 400 oracle oracle 19261 1 126488 0.00 tnslsnr /u01/app/oracle/product/db/11.2.0.3/bin/tnslsnr LISTENER -inherit | ||
992 | elif env UNIX95=1 ps -eo 'state uid ruid user ruser pid ppid vsz pcpu comm args' 2>/dev/null | head -n 1 | \ | ||
993 | egrep -i ["^ *S +UID +RUID +USER +RUSER +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null | ||
994 | then | ||
995 | ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]" | ||
996 | ac_cv_ps_command="$PATH_TO_ENV UNIX95=1 $PATH_TO_PS -eo 'state uid pid ppid vsz pcpu comm args'" | ||
997 | ac_cv_ps_format="%s %d %d %d %d %f %s %n" | ||
998 | ac_cv_ps_cols=8 | ||
999 | AC_MSG_RESULT([$ac_cv_ps_command]) | ||
1000 | |||
934 | dnl AIX 4.1: | 1001 | dnl AIX 4.1: |
935 | dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD | 1002 | dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD |
936 | dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper | 1003 | dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper |
@@ -995,6 +1062,10 @@ if test -n "$ac_cv_ps_varlist" ; then | |||
995 | AC_DEFINE(PS_USES_PROCETIME,"yes", | 1062 | AC_DEFINE(PS_USES_PROCETIME,"yes", |
996 | [Whether the ps utility uses the "procetime" field]) | 1063 | [Whether the ps utility uses the "procetime" field]) |
997 | 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 | ||
998 | fi | 1069 | fi |
999 | 1070 | ||
1000 | AC_PATH_PROG(PATH_TO_PING,ping) | 1071 | AC_PATH_PROG(PATH_TO_PING,ping) |
@@ -1039,6 +1110,14 @@ then | |||
1039 | ac_cv_ping_packets_first=yes | 1110 | ac_cv_ping_packets_first=yes |
1040 | AC_MSG_RESULT([$with_ping_command]) | 1111 | AC_MSG_RESULT([$with_ping_command]) |
1041 | 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]) | ||
1042 | 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 | \ |
1043 | egrep -i "^round-trip|^rtt" >/dev/null | 1122 | egrep -i "^round-trip|^rtt" >/dev/null |
1044 | then | 1123 | then |
@@ -1464,6 +1543,16 @@ else | |||
1464 | AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin]) | 1543 | AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin]) |
1465 | fi | 1544 | fi |
1466 | 1545 | ||
1546 | AC_PATH_PROG(PATH_TO_SUDO,sudo) | ||
1547 | AC_ARG_WITH(sudo_command, | ||
1548 | ACX_HELP_STRING([--with-sudo-command=PATH], | ||
1549 | [sets path to sudo]), PATH_TO_SUDO=$withval) | ||
1550 | if test -n "$PATH_TO_SUDO" | ||
1551 | then | ||
1552 | AC_DEFINE_UNQUOTED(PATH_TO_SUDO,"$PATH_TO_SUDO",[path to sudo]) | ||
1553 | else | ||
1554 | AC_MSG_WARN([Could not find sudo or eqivalent]) | ||
1555 | fi | ||
1467 | 1556 | ||
1468 | AC_PATH_PROG(PATH_TO_MAILQ,mailq) | 1557 | AC_PATH_PROG(PATH_TO_MAILQ,mailq) |
1469 | AC_ARG_WITH(mailq_command, | 1558 | AC_ARG_WITH(mailq_command, |
@@ -1851,4 +1940,5 @@ ACX_FEATURE([enable],[perl-modules]) | |||
1851 | ACX_FEATURE([with],[cgiurl]) | 1940 | ACX_FEATURE([with],[cgiurl]) |
1852 | ACX_FEATURE([with],[trusted-path]) | 1941 | ACX_FEATURE([with],[trusted-path]) |
1853 | ACX_FEATURE([enable],[libtap]) | 1942 | ACX_FEATURE([enable],[libtap]) |
1854 | 1943 | ACX_FEATURE([with],[libcurl]) | |
1944 | ACX_FEATURE([with],[uriparser]) | ||