1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION ($Revision$)
4 AC_INIT(nagios-plugins,1.4.11)
5 AC_CONFIG_SRCDIR(NPTest.pm)
6 AC_CONFIG_FILES(gl/Makefile)
7 AC_CONFIG_AUX_DIR(build-aux)
8 AM_INIT_AUTOMAKE([1.8.3])
9 AM_CONFIG_HEADER(config.h)
15 AC_PREFIX_DEFAULT(/usr/local/nagios)
17 dnl Deprecated configure options
20 dnl Append user (-o), group (-g), mode (-m) to install command
21 dnl There is an assumption that this is possible with ./configure's chosen install command
23 AC_ARG_WITH(nagios_user,
24 ACX_HELP_STRING([--with-nagios-user=USER],
25 [Installs executables with this user. Defaults to install user]),
26 extra_install_args="-o $withval")
27 AC_ARG_WITH(nagios_group,
28 ACX_HELP_STRING([--with-nagios-group=GROUP],
29 [Installs executables with this group. Defaults to install user]),
30 extra_install_args="$extra_install_args -g $withval")
31 AC_ARG_WITH(world_permissions,
32 ACX_HELP_STRING([--without-world-permissions],
33 [Installs executables without world permissions]))
35 if test "x$with_world_permissions" = xno ; then
36 extra_install_args="$extra_install_args -m 0550"
39 INSTALL="$INSTALL $extra_install_args"
40 INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
45 AC_PROG_GCC_TRADITIONAL
53 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
55 PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
56 AC_SUBST(PLUGIN_TEST)dnl
58 SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
59 AC_SUBST(SCRIPT_TEST)dnl
61 WARRANTY="The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
64 SUPPORT="Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n"
67 dnl CGIURL has changed for Nagios with 1.0 beta
69 ACX_HELP_STRING([--with-cgiurl=DIR],
70 [sets URL for cgi programs]),
72 with_cgiurl=/nagios/cgi-bin)
74 AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
76 AC_ARG_WITH(trusted_path,
77 ACX_HELP_STRING([--with-trusted-path=PATH],
78 [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
79 with_trusted_path=$withval,
80 with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
81 AC_SUBST(with_trusted_path)
85 dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
87 LDFLAGS="$LDFLAGS -L."
89 ac_cv_uname_m=`uname -m`
90 ac_cv_uname_s=`uname -s`
91 ac_cv_uname_r=`uname -r`
92 ac_cv_uname_v=`uname -v`
95 REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
96 REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
99 AC_SUBST(REV_DATESTAMP)
100 AC_SUBST(REV_TIMESTAMP)
102 dnl Checks for programs.
103 AC_PATH_PROG(PYTHON,python)
105 AC_PATH_PROG(PERL,perl)
106 AC_PATH_PROG(LIBGNUTLS_CONFIG,libgnutls-config)
107 AC_PATH_PROG(HOSTNAME,hostname)
108 AC_PATH_PROG(BASENAME,basename)
110 dnl allow them to override the path of perl
112 ACX_HELP_STRING([--with-perl=PATH],
113 [sets path to perl executable]),
114 with_perl=$withval,with_perl=$PERL)
115 AC_SUBST(PERL, $with_perl)
119 AC_HELP_STRING([--with-openssl=DIR],
120 [path to openssl installation]),)
123 ACX_HELP_STRING([--with-gnutls=PATH],
124 [path to gnutls installation root]),)
126 dnl you can only have one or the other
127 if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
130 if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
134 dnl list of possible dirs to try to autodetect openssl
135 dnl if $dir/include exists, we consider it found
136 dnl the order should allow locally installed versions to override distros' ones
137 OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
142 dnl Checks for libraries.
145 AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
146 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
147 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
148 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
152 dnl check for math-related functions needing -lm
153 AC_CHECK_HEADERS(math.h)
154 AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
157 dnl Check for libtap, to run perl-like tests
158 AC_CHECK_LIB(tap, plan_tests,
159 EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
163 dnl Check for PostgreSQL libraries
165 _SAVEDCPPFLAGS="$CPPFLAGS"
167 ACX_HELP_STRING([--with-pgsql=DIR],
168 [sets path to pgsql installation]),
170 AC_CHECK_LIB(crypt,main)
171 if test "$ac_cv_lib_crypt_main" = "yes"; then
172 if test -n "$PGSQL"; then
173 LDFLAGS="$LDFLAGS -L$PGSQL/lib"
174 CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
176 AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
177 if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
178 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
179 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
180 AC_CHECK_HEADERS(libpq-fe.h)
181 if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
182 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
183 PGINCLUDE="-I$PGSQL/include"
184 elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
185 PGLIBS="-lpq -lcrypt"
186 PGINCLUDE="-I/usr/include/pgsql"
187 elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
188 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
189 PGINCLUDE="-I/usr/include/postgresql"
190 elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
191 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
192 PGINCLUDE="-I$PGSQL/include"
194 if test -z "$PGINCLUDE"; then
195 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
196 AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
200 EXTRAS="$EXTRAS check_pgsql"
203 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
204 AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
205 AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
208 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
209 AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
212 CPPFLAGS="$_SAVEDCPPFLAGS"
214 dnl Check for radius libraries
216 AC_CHECK_LIB(radiusclient,rc_read_config)
217 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
218 EXTRAS="$EXTRAS check_radius"
219 RADIUSLIBS="-lradiusclient"
222 AC_CHECK_LIB(radiusclient-ng,rc_read_config)
223 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
224 EXTRAS="$EXTRAS check_radius"
225 RADIUSLIBS="-lradiusclient-ng"
228 AC_MSG_WARN([Skipping radius plugin])
229 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
234 dnl Check for LDAP libraries
236 AC_CHECK_LIB(ldap,main,,,-llber)
237 if test "$ac_cv_lib_ldap_main" = "yes"; then
238 LDAPLIBS="-lldap -llber"\
239 LDAPINCLUDE="-I/usr/include/ldap"
241 AC_SUBST(LDAPINCLUDE)
242 AC_CHECK_FUNCS(ldap_set_option)
243 EXTRAS="$EXTRAS check_ldap"
244 AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
246 AC_MSG_WARN([Skipping LDAP plugin])
247 AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
251 dnl Check for headers used by check_ide_smart
252 AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
253 if test "$FOUNDINCLUDE" = "yes" ; then
254 AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
257 if test "$FOUNDINCLUDE" = "yes" ; then
258 EXTRAS="$EXTRAS check_ide_smart"
260 AC_MSG_WARN([Skipping check_ide_smart plugin.])
261 AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.])
264 dnl Check for mysql libraries
266 if test $with_mysql = "no" ; then
267 AC_MSG_WARN([Skipping mysql plugin])
268 AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
270 EXTRAS="$EXTRAS check_mysql check_mysql_query"
271 MYSQLINCLUDE="$np_mysql_include"
272 MYSQLLIBS="$np_mysql_libs"
273 MYSQLCFLAGS="$np_mysql_cflags"
274 AC_SUBST(MYSQLINCLUDE)
276 AC_SUBST(MYSQLCFLAGS)
280 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
281 [], [with_ipv6=check])
283 dnl Check for AF_INET6 support - unistd.h required for Darwin
284 if test "$with_ipv6" != "no"; then
285 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
287 [#ifdef HAVE_UNISTD_H
290 #include <netinet/in.h>
291 #include <sys/socket.h>],
292 [struct sockaddr_in6 sin6;
295 sin6.sin6_family = AF_INET6;
296 sin6.sin6_port = 587;
297 p = &sin6.sin6_addr;],
298 [np_cv_sys_ipv6=yes],
301 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
302 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
304 if test "$np_cv_sys_ipv6" = "yes"; then
305 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
307 with_ipv6="$np_cv_sys_ipv6"
311 dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
312 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
313 if test "$FOUNDINCLUDE" = "no"; then
314 _SAVEDCPPFLAGS="$CPPFLAGS"
315 CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
316 unset ac_cv_header_krb5_h
317 AC_CHECK_HEADERS(krb5.h,
318 KRB5INCLUDE="-I/usr/kerberos/include"
323 if test "$FOUNDINCLUDE" = "no"; then
324 CPPFLAGS="$_SAVEDCPPFLAGS"
328 dnl openssl detection/configuration
329 if ! test x"$with_openssl" = x"no"; then
330 dnl Check for OpenSSL location if it wasn't already specified
331 if ! test -d "$with_openssl"; then
332 for d in $OPENSSL_DIRS; do
333 if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
339 _SAVEDCPPFLAGS="$CPPFLAGS"
340 _SAVEDLDFLAGS="$LDFLAGS"
341 dnl Check for OpenSSL header files
343 if test x"$with_openssl" != x"/usr" ; then
344 CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
345 LDFLAGS="$LDFLAGS -L$with_openssl/lib"
348 dnl check for openssl in $dir/include/openssl
349 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
350 SSLINCLUDE="-I$with_openssl/include"
353 dnl else check to see if $dir/include has it
354 if test "$FOUNDINCLUDE" = "no"; then
355 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
356 SSLINCLUDE="-I$with_openssl/include"
361 dnl if we didn't find it, reset CPPFLAGS
362 if test "$FOUNDINCLUDE" = "no"; then
363 CPPFLAGS="$_SAVEDCPPFLAGS"
364 LDFLAGS="$_SAVEDLDFLAGS"
367 dnl Check for crypto lib
369 LIBS="-L${with_openssl}/lib"
370 AC_CHECK_LIB(crypto,CRYPTO_lock)
371 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
372 dnl Check for SSL lib
373 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
377 dnl test headers and libs to decide whether check_http should use SSL
378 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
379 if test "$ac_cv_lib_ssl_main" = "yes"; then
380 if test "$FOUNDINCLUDE" = "yes"; then
388 dnl check for gnutls if openssl isn't found (or is disabled)
389 if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
390 if test ! "$with_gnutls" = ""; then
391 CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
392 elif test ! "$LIBGNUTLS_CONFIG" = ""; then
393 CPPFLAGS="$CPPFLAGS -I`$LIBGNUTLS_CONFIG --prefix`"
395 AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
396 if test "$FOUNDGNUTLS" = "yes"; then
397 AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
400 dnl end check for gnutls
402 if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
403 check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
404 AC_SUBST(check_tcp_ssl)
406 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
407 if test "$FOUNDOPENSSL" = "yes"; then
408 AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
412 AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
417 dnl else deliberately disabled or no ssl support available
418 AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
424 dnl Checks for header files.
429 AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
430 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
432 dnl Checks for typedefs, structures, and compiler characteristics.
440 AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
441 AC_TRY_LINK([#include <stdarg.h>
442 va_list ap1,ap2;], [va_copy(ap1,ap2);],
443 ac_cv_HAVE_VA_COPY=yes,
444 ac_cv_HAVE_VA_COPY=no)])
445 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
446 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
448 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
449 AC_TRY_LINK([#include <stdarg.h>
450 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
451 ac_cv_HAVE___VA_COPY=yes,
452 ac_cv_HAVE___VA_COPY=no)])
453 if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
454 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
458 AC_TRY_COMPILE([#include <sys/time.h>],
460 struct timezone *tz;],
461 AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
462 AC_TRY_COMPILE([#include <sys/time.h>],
465 gettimeofday(tv, tz);],
466 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
467 AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
469 dnl Checks for library functions.
470 AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
473 AC_MSG_CHECKING(return type of socket size)
474 AC_TRY_COMPILE([#include <stdlib.h>
475 #include <sys/types.h>
476 #include <sys/socket.h>],
477 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
478 ac_cv_socket_size_type=["size_t"]
479 AC_MSG_RESULT(size_t),
480 ac_cv_socket_size_type=["int"]
483 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
484 [Define type of socket size])
487 dnl #### Process table test
489 AC_PATH_PROG(PATH_TO_PS,ps)
491 AC_MSG_CHECKING(for ps syntax)
492 AC_ARG_WITH(ps_command,
493 ACX_HELP_STRING([--with-ps-command=PATH],
494 [Verbatim command to execute for ps]),
496 AC_ARG_WITH(ps_format,
497 ACX_HELP_STRING([--with-ps-format=FORMAT],
498 [Format string for scanning ps output]),
501 ACX_HELP_STRING([--with-ps-cols=NUM],
502 [Number of columns in ps command]),
504 AC_ARG_WITH(ps_varlist,
505 ACX_HELP_STRING([--with-ps-varlist=LIST],
506 [Variable list for sscanf of 'ps' output]),
509 if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
510 ac_cv_ps_command="$PS_COMMAND"
511 ac_cv_ps_format="$PS_FORMAT"
512 ac_cv_ps_varlist="$PS_VARLIST"
513 ac_cv_ps_cols="$PS_COLS"
514 AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
516 dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
517 elif test "$ac_cv_uname_s" = "SunOS"; then
519 # this is a very, very ugly hack, to hardcode the location for plugins
521 if test "$libexecdir" = '${exec_prefix}/libexec'; then
522 if test "$exec_prefix" = "NONE"; then
523 if test "$prefix" = "NONE"; then
524 pst3="$ac_default_prefix/libexec/pst3"
526 pst3="$prefix/libexec/pst3"
529 pst3="$exec_prefix/libexec/pst3"
532 pst3="$libexecdir/pst3"
534 ac_cv_ps_command="$pst3"
535 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
536 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
538 AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris])
539 if test `isainfo -b` = 64 ; then
542 AC_MSG_NOTICE([using 64bit pst3])
544 AC_MSG_NOTICE([using 32bit pst3])
546 EXTRAS_ROOT="$EXTRAS_ROOT pst3"
548 dnl Removing this for the moment - Ton
549 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
550 dnl Limitation that command name is not available
551 dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
552 dnl egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
554 dnl ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
555 dnl ac_cv_ps_command="/usr/ucb/ps -alxwwn"
556 dnl ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
558 dnl AC_MSG_RESULT([$ac_cv_ps_command])
560 dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
561 dnl so test for this first...
562 elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
563 egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
565 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
566 ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
567 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
569 AC_MSG_RESULT([$ac_cv_ps_command])
571 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
572 dnl Should also work for FreeBSD 5.2.1 and 5.3
573 dnl STAT UCOMM VSZ RSS USER PPID COMMAND
574 elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
575 egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
577 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
578 ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
579 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
581 AC_MSG_RESULT([$ac_cv_ps_command])
583 dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
584 dnl Limitation: Only first 16 chars returned for ucomm field
585 dnl Must come before ps -weo
586 elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
587 egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
589 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
590 ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
591 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
593 AC_MSG_RESULT([$ac_cv_ps_command])
595 dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
596 elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
597 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
599 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
600 ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
601 ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
603 AC_MSG_RESULT([$ac_cv_ps_command])
606 elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
607 egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
609 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
610 ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
611 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
613 AC_MSG_RESULT([$ac_cv_ps_command])
615 dnl BSD-like mode in RH 6.1
616 elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
617 egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
619 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
620 ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
621 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
623 AC_MSG_RESULT([$ac_cv_ps_command])
626 dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
627 dnl Need the head -1 otherwise test will work because arguments are found
628 elif ps -laxnwww 2>/dev/null | head -1 | \
629 egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
631 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
632 ac_cv_ps_command="$PATH_TO_PS -laxnwww"
633 ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
635 AC_MSG_RESULT([$ac_cv_ps_command])
637 dnl Debian Linux / procps v1.2.9:
638 dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
639 dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
641 elif ps laxnwww 2>/dev/null | \
642 egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
644 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
645 ac_cv_ps_command="$PATH_TO_PS laxnwww"
646 ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
648 AC_MSG_RESULT([$ac_cv_ps_command])
650 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
651 elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
652 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
654 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
655 ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
656 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
658 AC_MSG_RESULT([$ac_cv_ps_command])
660 dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
661 dnl Has /usr/bin/ps and /sbin/ps - force sbin version
662 dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
663 dnl of 1500). Will need big changes to check_procs to support
664 elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
665 egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
667 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
668 ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
669 ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
671 AC_MSG_RESULT([$ac_cv_ps_command])
673 elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
674 egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
676 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
677 ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
678 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
680 AC_MSG_RESULT([$ac_cv_ps_command])
682 dnl AIX 4.3.3 and 5.1 do not have an rss field
683 elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
684 egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
686 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
687 ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
688 ac_cv_ps_format="%s %d %d %d %d %f %s %n"
690 AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
693 elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
694 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
696 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
697 ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
698 # There must be no space between the %s and %n due to a wierd problem in sscanf where
699 # it will return %n as longer than the line length
700 ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
702 AC_MSG_RESULT([$ac_cv_ps_command])
704 elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
705 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
707 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
708 ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
709 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
711 AC_MSG_RESULT([$ac_cv_ps_command])
713 elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
714 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
716 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
717 ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
718 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
720 AC_MSG_RESULT([$ac_cv_ps_command])
722 dnl wonder who takes state instead of stat
723 elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
724 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
726 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
727 ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
728 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
730 AC_MSG_RESULT([$ac_cv_ps_command])
733 elif ps -el 2>/dev/null | \
734 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
736 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
737 ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
738 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
740 AC_MSG_RESULT([$ac_cv_ps_command])
743 elif ps -el 2>/dev/null | \
744 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
746 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
747 ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
748 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
750 AC_MSG_RESULT([$ac_cv_ps_command])
753 dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
754 dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
755 elif ps -el 2>/dev/null | \
756 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
758 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
759 ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
760 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
762 AC_MSG_RESULT([$ac_cv_ps_command])
765 elif ps glaxen 2>/dev/null | \
766 egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
768 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
769 ac_cv_ps_command="$PATH_TO_PS glaxen"
770 ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
772 AC_MSG_RESULT([$ac_cv_ps_command])
775 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
776 dnl Some truncation will happen in UCOMM column
777 dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
778 dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
779 elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
780 egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
782 ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
783 ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
784 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
786 AC_MSG_RESULT([$ac_cv_ps_command])
789 elif ps -Al 2>/dev/null | \
790 egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
792 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
793 ac_cv_ps_command="$PATH_TO_PS -Al"
794 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
796 AC_MSG_RESULT([$ac_cv_ps_command])
799 AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
802 if test -n "$ac_cv_ps_varlist" ; then
803 AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
804 [Variable list for sscanf of 'ps' output])
805 AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
806 [Verbatim command to execute for ps in check_procs])
807 AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
808 [Format string for scanning ps output in check_procs])
809 AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
810 [Number of columns in ps command])
811 EXTRAS="$EXTRAS check_procs check_nagios"
812 if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
813 AC_DEFINE(PS_USES_PROCETIME,"yes",
814 [Whether the ps utility uses the "procetime" field])
818 AC_PATH_PROG(PATH_TO_PING,ping)
819 AC_PATH_PROG(PATH_TO_PING6,ping6)
821 AC_ARG_WITH(ping_command,
822 ACX_HELP_STRING([--with-ping-command=SYNTAX],
823 [sets syntax for ICMP ping]),
824 with_ping_command=$withval,)
826 AC_MSG_CHECKING(for ICMP ping syntax)
827 ac_cv_ping_packets_first=no
828 ac_cv_ping_has_timeout=no
829 if test -n "$with_ping_command"
831 AC_MSG_RESULT([(command-line) $with_ping_command])
832 if test -n "$ac_cv_ping_packets_first"
834 ac_cv_ping_packets_first=yes
835 ac_cv_ping_has_timeout=yes
838 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
839 $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
840 egrep -i "^round-trip|^rtt" >/dev/null
842 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
843 ac_cv_ping_packets_first=yes
844 AC_MSG_RESULT([$with_ping_command])
846 elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
847 egrep -i "^round-trip|^rtt" >/dev/null
849 with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
850 ac_cv_ping_packets_first=yes
851 ac_cv_ping_has_timeout=yes
852 AC_MSG_RESULT([$with_ping_command])
854 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
855 egrep -i "^round-trip|^rtt" >/dev/null
857 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
858 ac_cv_ping_packets_first=yes
859 AC_MSG_RESULT([$with_ping_command])
861 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
862 egrep -i "^round-trip|^rtt" >/dev/null
864 with_ping_command="$PATH_TO_PING -n -c %d %s"
865 ac_cv_ping_packets_first=yes
866 AC_MSG_RESULT([$with_ping_command])
868 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
869 egrep -i "^round-trip|^rtt" >/dev/null
871 with_ping_command="$PATH_TO_PING -n %s -c %d"
872 AC_MSG_RESULT([$with_ping_command])
874 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
875 egrep -i "^round-trip|^rtt" >/dev/null
877 with_ping_command="$PATH_TO_PING %s -n %d"
878 AC_MSG_RESULT([$with_ping_command])
880 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
881 egrep -i "^round-trip|^rtt" >/dev/null
883 with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
884 AC_MSG_RESULT([$with_ping_command])
886 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
887 egrep -i "^round-trip|^rtt" >/dev/null
889 with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
890 AC_MSG_RESULT([$with_ping_command])
892 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
893 egrep -i "^round-trip|^rtt" >/dev/null
895 with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
896 ac_cv_ping_packets_first=yes
897 AC_MSG_RESULT([$with_ping_command])
899 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
900 egrep -i "^round-trip|^rtt" >/dev/null
902 with_ping_command="$PATH_TO_PING -n -c %d %s"
903 ac_cv_ping_packets_first=yes
904 AC_MSG_RESULT([$with_ping_command])
907 AC_MSG_WARN([unable to find usable ping syntax])
910 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
911 [path and args for ICMP ping command])
913 if test "x$ac_cv_ping_packets_first" != "xno"
915 AC_DEFINE(PING_PACKETS_FIRST,1,
916 [Define if packet count must precede host])
919 if test "x$ac_cv_ping_has_timeout" != "xno"
921 AC_DEFINE(PING_HAS_TIMEOUT,1,
922 [Define if ping has its own timeout option that should be set])
925 AC_ARG_WITH(ping6_command,
926 ACX_HELP_STRING([--with-ping6-command=SYNTAX],
927 [sets syntax for ICMPv6 ping]),
928 with_ping6_command=$withval,)
930 if test x"$with_ipv6" != xno ; then
931 AC_MSG_CHECKING(for ICMPv6 ping syntax)
932 ac_cv_ping6_packets_first=no
933 if test -n "$with_ping6_command"
935 AC_MSG_RESULT([(command-line) $with_ping6_command])
936 if test -n "$ac_cv_ping6_packets_first"
938 ac_cv_ping6_packets_first=yes
941 elif test "x$PATH_TO_PING6" != "x"; then
942 if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
943 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
944 egrep -i "^round-trip|^rtt" >/dev/null
946 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
947 ac_cv_ping6_packets_first=yes
948 AC_MSG_RESULT([$with_ping6_command])
950 elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
951 egrep -i "^round-trip|^rtt" >/dev/null
953 with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
954 ac_cv_ping6_packets_first=yes
955 ac_cv_ping_has_timeout=yes
956 AC_MSG_RESULT([$with_ping6_command])
958 elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
959 egrep -i "^round-trip|^rtt" >/dev/null
961 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
962 ac_cv_ping6_packets_first=yes
963 AC_MSG_RESULT([$with_ping6_command])
965 elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
966 egrep -i "^round-trip|^rtt" >/dev/null
968 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
969 ac_cv_ping6_packets_first=yes
970 AC_MSG_RESULT([$with_ping6_command])
972 elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
973 egrep -i "^round-trip|^rtt" >/dev/null
975 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
976 AC_MSG_RESULT([$with_ping6_command])
978 elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
979 egrep -i "^round-trip|^rtt" >/dev/null
981 with_ping6_command="$PATH_TO_PING6 %s -n %d"
982 AC_MSG_RESULT([$with_ping6_command])
984 elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
985 egrep -i "^round-trip|^rtt" >/dev/null
987 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
988 AC_MSG_RESULT([$with_ping6_command])
990 elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
991 egrep -i "^round-trip|^rtt" >/dev/null
993 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
994 AC_MSG_RESULT([$with_ping6_command])
996 elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
997 egrep -i "^round-trip|^rtt" >/dev/null
999 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1000 ac_cv_ping6_packets_first=yes
1001 AC_MSG_RESULT([$with_ping_command])
1003 elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1004 egrep -i "^round-trip|^rtt" >/dev/null
1006 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1007 ac_cv_ping6_packets_first=yes
1008 AC_MSG_RESULT([$with_ping6_command])
1012 elif test "x$PATH_TO_PING" != "x"; then
1013 if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1014 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1015 egrep -i "^round-trip|^rtt" >/dev/null
1017 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1018 ac_cv_ping6_packets_first=yes
1019 AC_MSG_RESULT([$with_ping6_command])
1021 elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1022 egrep -i "^round-trip|^rtt" >/dev/null
1024 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1025 ac_cv_ping6_packets_first=yes
1026 AC_MSG_RESULT([$with_ping6_command])
1028 elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1029 egrep -i "^round-trip|^rtt" >/dev/null
1031 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1032 ac_cv_ping6_packets_first=yes
1033 AC_MSG_RESULT([$with_ping6_command])
1035 elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1036 egrep -i "^round-trip|^rtt" >/dev/null
1038 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1039 AC_MSG_RESULT([$with_ping6_command])
1041 elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1042 egrep -i "^round-trip|^rtt" >/dev/null
1044 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1045 AC_MSG_RESULT([$with_ping6_command])
1047 elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1048 egrep -i "^round-trip|^rtt" >/dev/null
1050 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1051 AC_MSG_RESULT([$with_ping6_command])
1053 elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1054 egrep -i "^round-trip|^rtt" >/dev/null
1056 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1057 AC_MSG_RESULT([$with_ping6_command])
1059 elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1060 egrep -i "^round-trip|^rtt" >/dev/null
1062 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1063 ac_cv_ping6_packets_first=yes
1064 AC_MSG_RESULT([$with_ping_command])
1066 elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1067 egrep -i "^round-trip|^rtt" >/dev/null
1069 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1070 ac_cv_ping6_packets_first=yes
1071 AC_MSG_RESULT([$with_ping6_command])
1077 if test "x$with_ping6_command" != "x"; then
1078 AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1079 [path and args for ICMPv6 ping command])
1081 AC_MSG_RESULT([none])
1084 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1085 AC_DEFINE(PING6_PACKETS_FIRST,1,
1086 [Define if packet count must precede host])
1091 AC_ARG_WITH(nslookup_command,
1092 ACX_HELP_STRING([--with-nslookup-command=PATH],
1093 [sets path to nslookup executable]),
1094 ac_cv_nslookup_command=$withval)
1095 if test -n "$ac_cv_nslookup_command"; then
1096 AC_MSG_NOTICE([Using specific nslookup at $ac_cv_nslookup_command])
1098 AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1099 if test -n "$PATH_TO_NSLOOKUP"
1101 AC_MSG_CHECKING(for nslookup syntax)
1102 if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1104 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1105 AC_MSG_RESULT([$ac_cv_nslookup_command])
1108 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1109 AC_MSG_RESULT([$ac_cv_nslookup_command])
1113 AC_MSG_WARN([nslookup command not found])
1117 if test -n "$ac_cv_nslookup_command"; then
1118 EXTRAS="$EXTRAS check_dns"
1119 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
1122 AC_MSG_CHECKING([for number of cpus])
1123 AC_TRY_COMPILE([#include <unistd.h>],
1124 [sysconf(_SC_NPROCESSORS_CONF) > 0;],
1125 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus])
1126 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1127 AC_MSG_RESULT([cannot calculate])
1130 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1131 AC_ARG_WITH(uptime_command,
1132 ACX_HELP_STRING([--with-uptime-command=PATH],
1133 [sets path to uptime]), PATH_TO_UPTIME=$withval)
1134 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1136 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1137 AC_ARG_WITH(rpcinfo_command,
1138 ACX_HELP_STRING([--with-rpcinfo-command=PATH],
1139 [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
1140 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1142 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1143 if test -x "$PATH_TO_LMSTAT"
1145 AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1147 AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1150 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1151 AC_ARG_WITH(smbclient_command,
1152 ACX_HELP_STRING([--with-smbclient-command=PATH],
1153 [sets path to smbclient]),
1154 PATH_TO_SMBCLIENT=$withval)
1155 if test -n "$PATH_TO_SMBCLIENT"
1157 AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1159 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1163 AC_PATH_PROG(PATH_TO_WHO,who)
1165 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1167 ac_cv_path_to_who="$PATH_TO_WHO -q"
1169 ac_cv_path_to_who="$PATH_TO_WHO"
1172 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1173 [path and arguments for invoking 'who'])
1175 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1176 AC_ARG_WITH(snmpget_command,
1177 ACX_HELP_STRING([--with-snmpget-command=PATH],
1178 [Path to snmpget command]),
1179 PATH_TO_SNMPGET=$withval)
1180 if test -n "$PATH_TO_SNMPGET"
1182 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1183 EXTRAS="$EXTRAS check_hpjd check_snmp"
1185 AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1188 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1189 AC_ARG_WITH(snmpgetnext_command,
1190 ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
1191 [Path to snmpgetnext command]),
1192 PATH_TO_SNMPGETNEXT=$withval)
1193 if test -n "$PATH_TO_SNMPGETNEXT"
1195 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1198 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
1200 AC_MSG_CHECKING(for Net::SNMP perl module)
1201 AC_MSG_RESULT([found])
1203 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1206 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1207 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1208 AC_ARG_WITH(qstat_command,
1209 ACX_HELP_STRING([--with-qstat-command=PATH],
1210 [Path to qstat command]), PATH_TO_QSTAT=$withval)
1212 if test -x "$PATH_TO_QUAKESTAT"
1214 ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1215 EXTRAS="$EXTRAS check_game"
1217 elif test -n "$PATH_TO_QSTAT"
1219 ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1220 EXTRAS="$EXTRAS check_game"
1222 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1225 if test $ac_cv_path_to_qstat
1227 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1228 [path to qstat/quakestat])
1231 AC_PATH_PROG(PATH_TO_FPING,fping)
1232 AC_ARG_WITH(fping_command,
1233 ACX_HELP_STRING([--with-fping-command=PATH],
1234 [Path to fping command]), PATH_TO_FPING=$withval)
1235 if test -n "$PATH_TO_FPING"
1237 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1238 EXTRAS="$EXTRAS check_fping"
1240 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1243 AC_PATH_PROG(PATH_TO_SSH,ssh)
1244 AC_ARG_WITH(ssh_command,
1245 ACX_HELP_STRING([--with-ssh-command=PATH],
1246 [sets path for ssh]), PATH_TO_SSH=$withval)
1247 if test -n "$PATH_TO_SSH"
1249 AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1250 EXTRAS="$EXTRAS check_by_ssh"
1252 AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1256 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1257 AC_ARG_WITH(mailq_command,
1258 ACX_HELP_STRING([--with-mailq-command=PATH],
1259 [sets path to mailq]), PATH_TO_MAILQ=$withval)
1260 if test -n "$PATH_TO_MAILQ"
1262 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1264 AC_MSG_WARN([Could not find mailq or eqivalent])
1267 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1268 if test -x "$PATH_TO_QMAIL_QSTAT"
1270 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1272 AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1275 dnl SWAP info required is amount allocated/available and amount free
1276 dnl The plugin works through all the swap devices and adds up the total swap
1278 AC_PATH_PROG(PATH_TO_SWAP,swap)
1279 if (test -n "$PATH_TO_SWAP")
1281 AC_MSG_CHECKING([for $PATH_TO_SWAP format])
1282 if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1285 ac_cv_swap_command="$PATH_TO_SWAP -l"
1286 if [$PATH_TO_SWAP -l 2>/dev/null | \
1287 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1290 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
1291 ac_cv_swap_conv=2048
1292 AC_MSG_RESULT([using IRIX format swap])
1294 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1296 ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
1297 ac_cv_swap_conv=2048
1298 AC_MSG_RESULT([using Unixware format swap])
1300 dnl if we don't know what format swap's output is
1301 dnl we might as well pretend we didn't see it
1303 ac_cv_swap_command=""
1306 dnl end if for PATH_TO_SWAP
1309 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1310 if (test -n "$PATH_TO_SWAPINFO")
1312 AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
1313 if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1316 ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1318 if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1320 ac_cv_swap_format=["%*s %f %*d %f"]
1321 ac_cv_swap_conv=1024
1322 AC_MSG_RESULT([using FreeBSD format swapinfo])
1325 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1328 ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
1329 ac_cv_swap_format=["%*s %f %*d %f"]
1330 ac_cv_swap_conv=1024
1331 AC_MSG_RESULT([using HP-UX format swapinfo])
1333 dnl end if for PATH_TO_SWAPINFO
1336 AC_PATH_PROG(PATH_TO_LSPS,lsps)
1337 if (test -n "$PATH_TO_LSPS")
1339 AC_MSG_CHECKING([for $PATH_TO_LSPS format])
1340 if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
1343 ac_cv_swap_command="$PATH_TO_LSPS -a"
1344 ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
1346 AC_MSG_RESULT([using AIX lsps])
1348 dnl end if for PATH_TO_SWAPINFO
1352 dnl test for swapctl system call, both the 2-arg and 3-arg variants
1353 dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
1354 dnl in the various BSD's
1357 AC_CHECK_HEADERS([sys/stat.h sys/param.h])
1358 AC_CHECK_HEADERS([sys/swap.h], [], [], [
1359 #ifdef HAVE_SYS_PARAM_H
1360 #include <sys/param.h>
1363 AC_CHECK_DECLS([swapctl],,,[
1365 #include <sys/types.h>
1366 #include <sys/param.h>
1367 #include <sys/stat.h>
1368 #include <sys/swap.h>
1370 AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
1371 #include <sys/types.h>
1372 #include <sys/param.h>
1373 #include <sys/stat.h>
1374 #include <sys/swap.h>
1376 AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1378 #include <sys/types.h>
1379 #include <sys/param.h>
1380 #include <sys/stat.h>
1381 #include <sys/swap.h>
1384 if test "$ac_cv_have_decl_swapctl" = "yes";
1386 EXTRAS="$EXTRAS check_swap"
1387 AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1388 if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1389 "$ac_cv_type_swapent_t" = "yes";
1391 AC_MSG_RESULT([yes])
1392 ac_cv_check_swap_swapctl_svr4="1";
1393 AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
1394 [Define if 2-argument SVR4 swapctl exists])
1397 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1398 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1400 AC_MSG_RESULT([yes])
1401 AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
1402 [Define if 3-argument BSD swapctl exists])
1407 AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
1408 if test "$ac_cv_check_swap_swapctl_svr4" = "1";
1411 dnl the SVR4 spec returns values in pages
1413 AC_MSG_RESULT([page])
1414 AC_CHECK_DECLS([sysconf])
1415 AC_MSG_CHECKING([for system page size])
1416 if test "$ac_cv_have_decl_sysconf" = "yes";
1418 AC_MSG_RESULT([determined by sysconf(3)])
1419 ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
1421 AC_MSG_WARN([don't know. guessing 4096k])
1426 dnl the BSD spec returns values in blocks
1428 AC_MSG_RESULT([blocks (assuming 512b)])
1429 ac_cv_swap_conv=2048
1431 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1432 [Conversion factor to MB])
1435 dnl end tests for the swapctl system calls
1439 if test "x$ac_cv_have_swap" != "x"
1441 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1442 EXTRAS="$EXTRAS check_swap"
1444 if test "x$ac_cv_swap_command" != "x"
1446 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1447 [Path to swap/swapinfo binary, with any args])
1448 AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1449 [Format string for parsing swap output])
1450 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1451 [Conversion factor to MB])
1454 AC_ARG_WITH(proc-meminfo,
1455 ACX_HELP_STRING([--with-proc-meminfo=PATH],
1456 [path to /proc/meminfo or equivalent]),
1457 ac_cv_proc_meminfo=$withval)
1458 dnl dunno why this does not work below - use hack (kbd)
1459 dnl fine on linux, broken on solaris
1460 dnl if /bin/test -e "/proc/meminfo"
1461 AC_MSG_CHECKING([for /proc/meminfo])
1462 if test -n "$ac_cv_proc_meminfo"; then
1463 AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
1464 elif [cat /proc/meminfo > /dev/null 2>&1]; then
1465 AC_MSG_RESULT([found /proc/meminfo])
1466 ac_cv_proc_meminfo="/proc/meminfo"
1471 if test -n "$ac_cv_proc_meminfo"; then
1472 AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1473 AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
1474 EXTRAS="$EXTRAS check_swap"
1477 AC_PATH_PROG(PATH_TO_DIG,dig)
1478 AC_ARG_WITH(dig_command,
1479 ACX_HELP_STRING([--with-dig-command=PATH],
1480 [Path to dig command]), PATH_TO_DIG=$withval)
1481 if test -n "$PATH_TO_DIG"; then
1482 EXTRAS="$EXTRAS check_dig"
1483 AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1486 AC_PATH_PROG(PATH_TO_APTGET,apt-get)
1487 AC_ARG_WITH(apt-get_command,
1488 ACX_HELP_STRING([--with-apt-get-command=PATH],
1489 [Path to apt-get command]),
1490 with_apt_get_command=$withval,
1491 with_apt_get_command=$PATH_TO_APTGET)
1492 AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
1493 if test -n "$PATH_TO_APTGET" ; then
1494 EXTRAS="$EXTRAS check_apt"
1498 if test -f plugins/check_nt.c ; then
1499 EXTRAS="$EXTRAS check_nt"
1500 elif test -f ../plugins/check_nt.c ; then
1501 EXTRAS="$EXTRAS check_nt"
1505 dnl used in check_dhcp
1506 AC_CHECK_HEADERS(sys/sockio.h)
1510 AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
1513 AC_DEFINE(__linux__,1,[sun specific code in check_dhcp.c])
1516 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
1519 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
1524 AC_SUBST(EXTRAS_ROOT)
1525 AC_SUBST(EXTRA_NETOBJS)
1528 AM_GNU_GETTEXT([external], [need-ngettext])
1529 AM_GNU_GETTEXT_VERSION(0.15)
1531 dnl Check for Redhat spopen problem
1532 dnl Wierd problem where ECHILD is returned from a wait call in error
1533 dnl Only appears to affect nslookup and dig calls. Only affects redhat around
1534 dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
1535 dnl We patch plugins/popen.c
1536 dnl Need to add smp because uname different on those
1537 dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1538 AC_ARG_ENABLE(redhat-pthread-workaround,
1539 AC_HELP_STRING([--enable-redhat-pthread-workaround],
1540 [force Redhat patch to be applied (default: test system)]),
1541 [ac_cv_enable_redhat_pthread_workaround=$enableval],
1542 [ac_cv_enable_redhat_pthread_workaround=test])
1543 if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
1544 if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
1545 AC_MSG_NOTICE([See http://nagiosplugins.org/faq/compile/configure_appears_to_hang if this next part takes a long time])
1546 AC_MSG_CHECKING(for redhat spopen problem)
1547 ( cd config_test && make && make test ) > /dev/null 2>&1
1548 if test $? -eq 0 ; then
1551 AC_MSG_RESULT(error)
1552 AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
1555 elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
1556 AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
1560 AC_ARG_ENABLE(perl-modules,
1561 AC_HELP_STRING([--enable-perl-modules],
1562 [Enables installation of Nagios::Plugin and its dependencies (default: no)]),
1563 [enable_perl_modules=$enableval],
1564 [enable_perl_modules=no])
1565 if test "$enable_perl_modules" = "yes" ; then
1566 AC_SUBST(PERLMODS_DIR,perlmods)
1569 dnl External libraries - see ACKNOWLEDGEMENTS
1572 dnl Some helpful common compile errors checked here
1573 if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_cv_prog_ac_ct_AR" = 'false' \) ; then
1574 AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
1582 plugins-root/Makefile
1583 plugins-scripts/Makefile
1584 plugins-scripts/subst
1585 plugins-scripts/utils.pm
1586 plugins-scripts/utils.sh
1595 dnl the ones below that are commented out need to be cleaned up
1596 dnl in the configure code above to use with_foo instead of ac_cv_foo
1597 dnl if we want them to show up here. it'd also make the code cleaner.
1598 dnl i'll get to that on another rainy day :) -sf
1599 ACX_FEATURE([with],[apt-get-command])
1600 dnl ACX_FEATURE([with],[dig-command])
1601 dnl ACX_FEATURE([with],[fping-command])
1602 dnl ACX_FEATURE([with],[mailq-command])
1603 dnl ACX_FEATURE([with],[nslookup-command])
1604 ACX_FEATURE([with],[ping6-command])
1605 ACX_FEATURE([with],[ping-command])
1606 dnl ACX_FEATURE([with],[qstat-command])
1607 dnl ACX_FEATURE([with],[rpcinfo-command])
1608 dnl ACX_FEATURE([with],[smbclient-command])
1609 dnl ACX_FEATURE([with],[snmpget-command])
1610 dnl ACX_FEATURE([with],[snmpgetnext-command])
1611 dnl ACX_FEATURE([with],[ssh-command])
1612 dnl ACX_FEATURE([with],[uptime-command])
1614 dnl ACX_FEATURE([with],[proc-meminfo])
1615 dnl ACX_FEATURE([with],[ps-command])
1616 dnl ACX_FEATURE([with],[ps-format])
1617 dnl ACX_FEATURE([with],[ps-cols])
1618 dnl ACX_FEATURE([with],[ps-varlist])
1620 ACX_FEATURE([with],[ipv6])
1621 ACX_FEATURE([with],[mysql])
1622 ACX_FEATURE([with],[openssl])
1623 ACX_FEATURE([with],[gnutls])
1624 ACX_FEATURE([with],[perl])
1625 ACX_FEATURE([enable],[perl-modules])
1626 ACX_FEATURE([with],[cgiurl])
1627 ACX_FEATURE([with],[trusted-path])