1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(nagios-plugins,1.4.14)
4 AC_CONFIG_SRCDIR(NPTest.pm)
5 AC_CONFIG_FILES(gl/Makefile)
6 AC_CONFIG_AUX_DIR(build-aux)
7 AM_INIT_AUTOMAKE([1.8.3])
8 AM_CONFIG_HEADER(config.h)
14 AC_PREFIX_DEFAULT(/usr/local/nagios)
16 dnl Deprecated configure options
19 dnl Append user (-o), group (-g), mode (-m) to install command
20 dnl There is an assumption that this is possible with ./configure's chosen install command
22 AC_ARG_WITH(nagios_user,
23 ACX_HELP_STRING([--with-nagios-user=USER],
24 [Installs executables with this user. Defaults to install user]),
25 extra_install_args="-o $withval")
26 AC_ARG_WITH(nagios_group,
27 ACX_HELP_STRING([--with-nagios-group=GROUP],
28 [Installs executables with this group. Defaults to install user]),
29 extra_install_args="$extra_install_args -g $withval")
30 AC_ARG_WITH(world_permissions,
31 ACX_HELP_STRING([--without-world-permissions],
32 [Installs executables without world permissions]))
34 if test "x$with_world_permissions" = xno ; then
35 extra_install_args="$extra_install_args -m 0550"
38 INSTALL="$INSTALL $extra_install_args"
39 INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
44 AC_PROG_GCC_TRADITIONAL
52 ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
54 PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
55 AC_SUBST(PLUGIN_TEST)dnl
57 SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
58 AC_SUBST(SCRIPT_TEST)dnl
60 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"
63 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"
66 dnl CGIURL has changed for Nagios with 1.0 beta
68 ACX_HELP_STRING([--with-cgiurl=DIR],
69 [sets URL for cgi programs]),
71 with_cgiurl=/nagios/cgi-bin)
73 AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
75 AC_ARG_WITH(trusted_path,
76 ACX_HELP_STRING([--with-trusted-path=PATH],
77 [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
78 with_trusted_path=$withval,
79 with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
80 AC_SUBST(with_trusted_path)
84 dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
86 LDFLAGS="$LDFLAGS -L."
88 ac_cv_uname_m=`uname -m`
89 ac_cv_uname_s=`uname -s`
90 ac_cv_uname_r=`uname -r`
91 ac_cv_uname_v=`uname -v`
94 REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
95 REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
98 AC_SUBST(REV_DATESTAMP)
99 AC_SUBST(REV_TIMESTAMP)
101 dnl Check if version file is present
102 AM_CONDITIONAL([RELEASE_PRESENT], [test -f $srcdir/release])
104 # Also read in the version from it
105 if test -f $srcdir/release; then
106 NP_RELEASE="$(<release)"
108 NP_RELEASE="$PACKAGE_VERSION"
112 dnl Checks for programs.
113 AC_PATH_PROG(PYTHON,python)
115 AC_PATH_PROG(PERL,perl)
116 AC_PATH_PROG(LIBGNUTLS_CONFIG,libgnutls-config)
117 AC_PATH_PROG(HOSTNAME,hostname)
118 AC_PATH_PROG(BASENAME,basename)
120 dnl allow them to override the path of perl
122 ACX_HELP_STRING([--with-perl=PATH],
123 [sets path to perl executable]),
124 with_perl=$withval,with_perl=$PERL)
125 AC_SUBST(PERL, $with_perl)
129 AC_HELP_STRING([--with-openssl=DIR],
130 [path to openssl installation]),)
133 ACX_HELP_STRING([--with-gnutls=PATH],
134 [path to gnutls installation root]),)
136 dnl you can only have one or the other
137 if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
140 if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
144 dnl list of possible dirs to try to autodetect openssl
145 dnl if $dir/include exists, we consider it found
146 dnl the order should allow locally installed versions to override distros' ones
147 OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
152 dnl Checks for libraries.
155 AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
156 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
157 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
158 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
162 dnl check for math-related functions needing -lm
163 AC_CHECK_HEADERS(math.h)
164 AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
167 dnl Check if we buils local libtap
168 AC_ARG_ENABLE(libtap,
169 AC_HELP_STRING([--enable-libtap],
170 [Enable built-in libtap for unit-testing (default: autodetect system library).]),
171 [enable_libtap=$enableval],
173 AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"])
175 # If not local, check if we can use the system one
176 if test "$enable_libtap" != "yes" ; then
177 dnl Check for libtap, to run perl-like tests
178 AC_CHECK_LIB(tap, plan_tests,
183 # Finally, define tests if we use libtap
184 if test "$enable_libtap" = "yes" ; then
185 EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
190 AC_ARG_ENABLE(extra-opts,
191 AC_HELP_STRING([--enable-extra-opts],
192 [Enables parsing of plugins ini config files for extra options (default: no)]),
193 [enable_extra_opts=$enableval],
194 [enable_extra_opts=no])
195 AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
196 if test "$enable_extra_opts" = "yes" ; then
197 AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
198 if test "$enable_libtap" = "yes"; then
199 EXTRA_TEST="$EXTRA_TEST test_ini1 test_ini3 test_opts1 test_opts2 test_opts3"
204 dnl Check for PostgreSQL libraries
206 _SAVEDCPPFLAGS="$CPPFLAGS"
208 ACX_HELP_STRING([--with-pgsql=DIR],
209 [sets path to pgsql installation]),
211 AC_CHECK_LIB(crypt,main)
212 if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
213 if test -n "$PGSQL"; then
214 LDFLAGS="$LDFLAGS -L$PGSQL/lib"
215 CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
217 AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
218 if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
219 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
220 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
221 AC_CHECK_HEADERS(libpq-fe.h)
222 if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
223 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
224 PGINCLUDE="-I$PGSQL/include"
225 elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
226 PGLIBS="-lpq -lcrypt"
227 PGINCLUDE="-I/usr/include/pgsql"
228 elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
229 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
230 PGINCLUDE="-I/usr/include/postgresql"
231 elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
232 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
233 PGINCLUDE="-I$PGSQL/include"
235 if test -z "$PGINCLUDE"; then
236 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
237 AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
241 EXTRAS="$EXTRAS check_pgsql"
244 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
245 AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
246 AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
249 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
250 AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
253 CPPFLAGS="$_SAVEDCPPFLAGS"
255 dnl Check for radius libraries
257 AC_CHECK_LIB(radiusclient,rc_read_config)
258 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
259 EXTRAS="$EXTRAS check_radius"
260 RADIUSLIBS="-lradiusclient"
263 AC_CHECK_LIB(radiusclient-ng,rc_read_config)
264 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
265 EXTRAS="$EXTRAS check_radius"
266 RADIUSLIBS="-lradiusclient-ng"
269 AC_MSG_WARN([Skipping radius plugin])
270 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
275 dnl Check for LDAP libraries
277 AC_CHECK_LIB(ldap,main,,,-llber)
278 if test "$ac_cv_lib_ldap_main" = "yes"; then
279 LDAPLIBS="-lldap -llber"\
280 LDAPINCLUDE="-I/usr/include/ldap"
282 AC_SUBST(LDAPINCLUDE)
283 AC_CHECK_FUNCS(ldap_set_option)
284 EXTRAS="$EXTRAS check_ldap"
285 AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
287 AC_MSG_WARN([Skipping LDAP plugin])
288 AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
292 dnl Check for headers used by check_ide_smart
293 AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
294 if test "$FOUNDINCLUDE" = "yes" ; then
295 AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
298 if test "$FOUNDINCLUDE" = "yes" ; then
299 EXTRAS="$EXTRAS check_ide_smart"
301 AC_MSG_WARN([Skipping check_ide_smart plugin.])
302 AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.])
305 dnl Check for mysql libraries
307 if test $with_mysql = "no" ; then
308 AC_MSG_WARN([Skipping mysql plugin])
309 AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
311 EXTRAS="$EXTRAS check_mysql check_mysql_query"
312 MYSQLINCLUDE="$np_mysql_include"
313 MYSQLLIBS="$np_mysql_libs"
314 MYSQLCFLAGS="$np_mysql_cflags"
315 AC_SUBST(MYSQLINCLUDE)
317 AC_SUBST(MYSQLCFLAGS)
321 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
322 [], [with_ipv6=check])
324 dnl Check for AF_INET6 support - unistd.h required for Darwin
325 if test "$with_ipv6" != "no"; then
326 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
328 [#ifdef HAVE_UNISTD_H
331 #include <netinet/in.h>
332 #include <sys/socket.h>],
333 [struct sockaddr_in6 sin6;
336 sin6.sin6_family = AF_INET6;
337 sin6.sin6_port = 587;
338 p = &sin6.sin6_addr;],
339 [np_cv_sys_ipv6=yes],
342 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
343 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
345 if test "$np_cv_sys_ipv6" = "yes"; then
346 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
348 with_ipv6="$np_cv_sys_ipv6"
352 dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
353 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
354 if test "$FOUNDINCLUDE" = "no"; then
355 _SAVEDCPPFLAGS="$CPPFLAGS"
356 CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
357 unset ac_cv_header_krb5_h
358 AC_CHECK_HEADERS(krb5.h,
359 KRB5INCLUDE="-I/usr/kerberos/include"
364 if test "$FOUNDINCLUDE" = "no"; then
365 CPPFLAGS="$_SAVEDCPPFLAGS"
368 dnl *** The following block comes from wget configure.ac ***
369 dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto
370 dnl shared library doesn't record its dependency on libdl, so we
371 dnl need to check for it ourselves so we won't fail to link due to a
372 dnl lack of -ldl. Most OSes use dlopen(), but HP-UX uses
374 AC_CHECK_LIB(dl,dlopen)
375 AC_CHECK_LIB(dl,shl_load)
377 dnl openssl detection/configuration
378 if ! test x"$with_openssl" = x"no"; then
379 dnl Check for OpenSSL location if it wasn't already specified
380 if ! test -d "$with_openssl"; then
381 for d in $OPENSSL_DIRS; do
382 if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
388 _SAVEDCPPFLAGS="$CPPFLAGS"
389 _SAVEDLDFLAGS="$LDFLAGS"
390 dnl Check for OpenSSL header files
392 if test x"$with_openssl" != x"/usr" ; then
393 CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
394 LDFLAGS="$LDFLAGS -L$with_openssl/lib"
397 dnl check for openssl in $dir/include/openssl
398 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
399 SSLINCLUDE="-I$with_openssl/include"
402 dnl else check to see if $dir/include has it
403 if test "$FOUNDINCLUDE" = "no"; then
404 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
405 SSLINCLUDE="-I$with_openssl/include"
410 dnl if we didn't find it, reset CPPFLAGS
411 if test "$FOUNDINCLUDE" = "no"; then
412 CPPFLAGS="$_SAVEDCPPFLAGS"
413 LDFLAGS="$_SAVEDLDFLAGS"
416 dnl Check for crypto lib
418 LIBS="-L${with_openssl}/lib"
419 AC_CHECK_LIB(crypto,CRYPTO_lock)
420 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
421 dnl Check for SSL lib
422 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
426 dnl test headers and libs to decide whether check_http should use SSL
427 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
428 if test "$ac_cv_lib_ssl_main" = "yes"; then
429 if test "$FOUNDINCLUDE" = "yes"; then
437 dnl check for gnutls if openssl isn't found (or is disabled)
438 if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
439 if test ! "$with_gnutls" = ""; then
440 CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
441 elif test ! "$LIBGNUTLS_CONFIG" = ""; then
442 CPPFLAGS="$CPPFLAGS -I`$LIBGNUTLS_CONFIG --prefix`"
444 AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
445 if test "$FOUNDGNUTLS" = "yes"; then
446 AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
449 dnl end check for gnutls
451 if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
452 check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
453 AC_SUBST(check_tcp_ssl)
455 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
456 if test "$FOUNDOPENSSL" = "yes"; then
457 AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
461 AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
466 dnl else deliberately disabled or no ssl support available
467 AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
473 dnl Checks for header files.
478 AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
479 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
481 dnl Checks for typedefs, structures, and compiler characteristics.
488 AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
489 AC_TRY_LINK([#include <stdarg.h>
490 va_list ap1,ap2;], [va_copy(ap1,ap2);],
491 ac_cv_HAVE_VA_COPY=yes,
492 ac_cv_HAVE_VA_COPY=no)])
493 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
494 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
496 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
497 AC_TRY_LINK([#include <stdarg.h>
498 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
499 ac_cv_HAVE___VA_COPY=yes,
500 ac_cv_HAVE___VA_COPY=no)])
501 if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
502 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
506 AC_TRY_COMPILE([#include <sys/time.h>],
508 struct timezone *tz;],
509 AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
510 AC_TRY_COMPILE([#include <sys/time.h>],
513 gettimeofday(tv, tz);],
514 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
515 AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
517 dnl Checks for library functions.
518 AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
521 AC_MSG_CHECKING(return type of socket size)
522 AC_TRY_COMPILE([#include <stdlib.h>
523 #include <sys/types.h>
524 #include <sys/socket.h>],
525 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
526 ac_cv_socket_size_type=["size_t"]
527 AC_MSG_RESULT(size_t),
528 ac_cv_socket_size_type=["int"]
531 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
532 [Define type of socket size])
535 dnl #### Process table test
537 AC_PATH_PROG(PATH_TO_PS,ps)
539 AC_MSG_CHECKING(for ps syntax)
540 AC_ARG_WITH(ps_command,
541 ACX_HELP_STRING([--with-ps-command=PATH],
542 [Verbatim command to execute for ps]),
544 AC_ARG_WITH(ps_format,
545 ACX_HELP_STRING([--with-ps-format=FORMAT],
546 [Format string for scanning ps output]),
549 ACX_HELP_STRING([--with-ps-cols=NUM],
550 [Number of columns in ps command]),
552 AC_ARG_WITH(ps_varlist,
553 ACX_HELP_STRING([--with-ps-varlist=LIST],
554 [Variable list for sscanf of 'ps' output]),
557 if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
558 ac_cv_ps_command="$PS_COMMAND"
559 ac_cv_ps_format="$PS_FORMAT"
560 ac_cv_ps_varlist="$PS_VARLIST"
561 ac_cv_ps_cols="$PS_COLS"
562 AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
564 dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
565 elif test "$ac_cv_uname_s" = "SunOS"; then
567 # this is a very, very ugly hack, to hardcode the location for plugins
569 if test "$libexecdir" = '${exec_prefix}/libexec'; then
570 if test "$exec_prefix" = "NONE"; then
571 if test "$prefix" = "NONE"; then
572 pst3="$ac_default_prefix/libexec/pst3"
574 pst3="$prefix/libexec/pst3"
577 pst3="$exec_prefix/libexec/pst3"
580 pst3="$libexecdir/pst3"
582 ac_cv_ps_command="$pst3"
583 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
584 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
586 AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris])
587 if test `isainfo -b` = 64 ; then
590 AC_MSG_NOTICE([using 64bit pst3])
592 AC_MSG_NOTICE([using 32bit pst3])
594 EXTRAS_ROOT="$EXTRAS_ROOT pst3"
596 dnl Removing this for the moment - Ton
597 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
598 dnl Limitation that command name is not available
599 dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
600 dnl egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
602 dnl ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
603 dnl ac_cv_ps_command="/usr/ucb/ps -alxwwn"
604 dnl ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
606 dnl AC_MSG_RESULT([$ac_cv_ps_command])
608 dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
609 dnl so test for this first...
610 elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
611 egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
613 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
614 ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
615 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
617 AC_MSG_RESULT([$ac_cv_ps_command])
619 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
620 dnl Should also work for FreeBSD 5.2.1 and 5.3
621 dnl STAT UCOMM VSZ RSS USER PPID COMMAND
622 elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
623 egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
625 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
626 ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
627 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
629 AC_MSG_RESULT([$ac_cv_ps_command])
631 dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
632 dnl Limitation: Only first 16 chars returned for ucomm field
633 dnl Must come before ps -weo
634 elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
635 egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
637 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
638 ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
639 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
641 AC_MSG_RESULT([$ac_cv_ps_command])
643 dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
644 elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
645 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
647 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
648 ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
649 ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
651 AC_MSG_RESULT([$ac_cv_ps_command])
654 elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
655 egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
657 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
658 ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
659 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
661 AC_MSG_RESULT([$ac_cv_ps_command])
663 dnl BSD-like mode in RH 6.1
664 elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
665 egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
667 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
668 ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
669 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
671 AC_MSG_RESULT([$ac_cv_ps_command])
674 dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
675 dnl Need the head -1 otherwise test will work because arguments are found
676 elif ps -laxnwww 2>/dev/null | head -1 | \
677 egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
679 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
680 ac_cv_ps_command="$PATH_TO_PS -laxnwww"
681 ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
683 AC_MSG_RESULT([$ac_cv_ps_command])
685 dnl Debian Linux / procps v1.2.9:
686 dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
687 dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
689 elif ps laxnwww 2>/dev/null | \
690 egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
692 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
693 ac_cv_ps_command="$PATH_TO_PS laxnwww"
694 ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
696 AC_MSG_RESULT([$ac_cv_ps_command])
698 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
699 elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
700 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
702 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
703 ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
704 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
706 AC_MSG_RESULT([$ac_cv_ps_command])
708 dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
709 dnl Has /usr/bin/ps and /sbin/ps - force sbin version
710 dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
711 dnl of 1500). Will need big changes to check_procs to support
712 elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
713 egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
715 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
716 ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
717 ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
719 AC_MSG_RESULT([$ac_cv_ps_command])
721 elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
722 egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
724 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
725 ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
726 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
728 AC_MSG_RESULT([$ac_cv_ps_command])
730 dnl AIX 4.3.3 and 5.1 do not have an rss field
731 elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
732 egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
734 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
735 ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
736 ac_cv_ps_format="%s %d %d %d %d %f %s %n"
738 AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
741 elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
742 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
744 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
745 ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
746 # There must be no space between the %s and %n due to a wierd problem in sscanf where
747 # it will return %n as longer than the line length
748 ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
750 AC_MSG_RESULT([$ac_cv_ps_command])
752 elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
753 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
755 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
756 ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
757 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
759 AC_MSG_RESULT([$ac_cv_ps_command])
761 elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
762 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
764 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
765 ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
766 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
768 AC_MSG_RESULT([$ac_cv_ps_command])
770 dnl wonder who takes state instead of stat
771 elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
772 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
774 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
775 ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
776 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
778 AC_MSG_RESULT([$ac_cv_ps_command])
781 elif ps -el 2>/dev/null | \
782 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
784 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
785 ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
786 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
788 AC_MSG_RESULT([$ac_cv_ps_command])
791 elif ps -el 2>/dev/null | \
792 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
794 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
795 ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
796 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
798 AC_MSG_RESULT([$ac_cv_ps_command])
801 dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
802 dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
803 elif ps -el 2>/dev/null | \
804 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
806 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
807 ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
808 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
810 AC_MSG_RESULT([$ac_cv_ps_command])
813 elif ps glaxen 2>/dev/null | \
814 egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
816 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
817 ac_cv_ps_command="$PATH_TO_PS glaxen"
818 ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
820 AC_MSG_RESULT([$ac_cv_ps_command])
823 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
824 dnl Some truncation will happen in UCOMM column
825 dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
826 dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
827 elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
828 egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
830 ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
831 ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
832 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
834 AC_MSG_RESULT([$ac_cv_ps_command])
837 elif ps -Al 2>/dev/null | \
838 egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
840 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
841 ac_cv_ps_command="$PATH_TO_PS -Al"
842 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
844 AC_MSG_RESULT([$ac_cv_ps_command])
847 AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
850 if test -n "$ac_cv_ps_varlist" ; then
851 AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
852 [Variable list for sscanf of 'ps' output])
853 AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
854 [Verbatim command to execute for ps in check_procs])
855 AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
856 [Format string for scanning ps output in check_procs])
857 AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
858 [Number of columns in ps command])
859 EXTRAS="$EXTRAS check_procs check_nagios"
860 if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
861 AC_DEFINE(PS_USES_PROCETIME,"yes",
862 [Whether the ps utility uses the "procetime" field])
866 AC_PATH_PROG(PATH_TO_PING,ping)
867 AC_PATH_PROG(PATH_TO_PING6,ping6)
869 AC_ARG_WITH(ping_command,
870 ACX_HELP_STRING([--with-ping-command=SYNTAX],
871 [sets syntax for ICMP ping]),
872 with_ping_command=$withval,)
874 AC_MSG_CHECKING(for ICMP ping syntax)
875 ac_cv_ping_packets_first=no
876 ac_cv_ping_has_timeout=no
877 if test -n "$with_ping_command"
879 AC_MSG_RESULT([(command-line) $with_ping_command])
880 if test -n "$ac_cv_ping_packets_first"
882 ac_cv_ping_packets_first=yes
883 ac_cv_ping_has_timeout=yes
886 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
887 $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
888 egrep -i "^round-trip|^rtt" >/dev/null
890 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
891 ac_cv_ping_packets_first=yes
892 AC_MSG_RESULT([$with_ping_command])
894 elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
895 egrep -i "^round-trip|^rtt" >/dev/null
897 with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
898 ac_cv_ping_packets_first=yes
899 ac_cv_ping_has_timeout=yes
900 AC_MSG_RESULT([$with_ping_command])
902 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
903 egrep -i "^round-trip|^rtt" >/dev/null
905 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
906 ac_cv_ping_packets_first=yes
907 AC_MSG_RESULT([$with_ping_command])
909 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
910 egrep -i "^round-trip|^rtt" >/dev/null
912 with_ping_command="$PATH_TO_PING -n -c %d %s"
913 ac_cv_ping_packets_first=yes
914 AC_MSG_RESULT([$with_ping_command])
916 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
917 egrep -i "^round-trip|^rtt" >/dev/null
919 with_ping_command="$PATH_TO_PING -n %s -c %d"
920 AC_MSG_RESULT([$with_ping_command])
922 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
923 egrep -i "^round-trip|^rtt" >/dev/null
925 with_ping_command="$PATH_TO_PING %s -n %d"
926 AC_MSG_RESULT([$with_ping_command])
928 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
929 egrep -i "^round-trip|^rtt" >/dev/null
931 with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
932 AC_MSG_RESULT([$with_ping_command])
934 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
935 egrep -i "^round-trip|^rtt" >/dev/null
937 with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
938 AC_MSG_RESULT([$with_ping_command])
940 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
941 egrep -i "^round-trip|^rtt" >/dev/null
943 with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
944 ac_cv_ping_packets_first=yes
945 AC_MSG_RESULT([$with_ping_command])
947 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
948 egrep -i "^round-trip|^rtt" >/dev/null
950 with_ping_command="$PATH_TO_PING -n -c %d %s"
951 ac_cv_ping_packets_first=yes
952 AC_MSG_RESULT([$with_ping_command])
955 AC_MSG_WARN([unable to find usable ping syntax])
958 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
959 [path and args for ICMP ping command])
961 if test "x$ac_cv_ping_packets_first" != "xno"
963 AC_DEFINE(PING_PACKETS_FIRST,1,
964 [Define if packet count must precede host])
967 if test "x$ac_cv_ping_has_timeout" != "xno"
969 AC_DEFINE(PING_HAS_TIMEOUT,1,
970 [Define if ping has its own timeout option that should be set])
973 AC_ARG_WITH(ping6_command,
974 ACX_HELP_STRING([--with-ping6-command=SYNTAX],
975 [sets syntax for ICMPv6 ping]),
976 with_ping6_command=$withval,)
978 if test x"$with_ipv6" != xno ; then
979 AC_MSG_CHECKING(for ICMPv6 ping syntax)
980 ac_cv_ping6_packets_first=no
981 if test -n "$with_ping6_command"
983 AC_MSG_RESULT([(command-line) $with_ping6_command])
984 if test -n "$ac_cv_ping6_packets_first"
986 ac_cv_ping6_packets_first=yes
989 elif test "x$PATH_TO_PING6" != "x"; then
990 if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
991 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
992 egrep -i "^round-trip|^rtt" >/dev/null
994 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
995 ac_cv_ping6_packets_first=yes
996 AC_MSG_RESULT([$with_ping6_command])
998 elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
999 egrep -i "^round-trip|^rtt" >/dev/null
1001 with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
1002 ac_cv_ping6_packets_first=yes
1003 ac_cv_ping_has_timeout=yes
1004 AC_MSG_RESULT([$with_ping6_command])
1006 elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
1007 egrep -i "^round-trip|^rtt" >/dev/null
1009 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
1010 ac_cv_ping6_packets_first=yes
1011 AC_MSG_RESULT([$with_ping6_command])
1013 elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1014 egrep -i "^round-trip|^rtt" >/dev/null
1016 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1017 ac_cv_ping6_packets_first=yes
1018 AC_MSG_RESULT([$with_ping6_command])
1020 elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
1021 egrep -i "^round-trip|^rtt" >/dev/null
1023 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1024 AC_MSG_RESULT([$with_ping6_command])
1026 elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1027 egrep -i "^round-trip|^rtt" >/dev/null
1029 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1030 AC_MSG_RESULT([$with_ping6_command])
1032 elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1033 egrep -i "^round-trip|^rtt" >/dev/null
1035 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1036 AC_MSG_RESULT([$with_ping6_command])
1038 elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1039 egrep -i "^round-trip|^rtt" >/dev/null
1041 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1042 AC_MSG_RESULT([$with_ping6_command])
1044 elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1045 egrep -i "^round-trip|^rtt" >/dev/null
1047 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1048 ac_cv_ping6_packets_first=yes
1049 AC_MSG_RESULT([$with_ping_command])
1051 elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1052 egrep -i "^round-trip|^rtt" >/dev/null
1054 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1055 ac_cv_ping6_packets_first=yes
1056 AC_MSG_RESULT([$with_ping6_command])
1060 elif test "x$PATH_TO_PING" != "x"; then
1061 if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1062 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1063 egrep -i "^round-trip|^rtt" >/dev/null
1065 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1066 ac_cv_ping6_packets_first=yes
1067 AC_MSG_RESULT([$with_ping6_command])
1069 elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1070 egrep -i "^round-trip|^rtt" >/dev/null
1072 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1073 ac_cv_ping6_packets_first=yes
1074 AC_MSG_RESULT([$with_ping6_command])
1076 elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1077 egrep -i "^round-trip|^rtt" >/dev/null
1079 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1080 ac_cv_ping6_packets_first=yes
1081 AC_MSG_RESULT([$with_ping6_command])
1083 elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1084 egrep -i "^round-trip|^rtt" >/dev/null
1086 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1087 AC_MSG_RESULT([$with_ping6_command])
1089 elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1090 egrep -i "^round-trip|^rtt" >/dev/null
1092 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1093 AC_MSG_RESULT([$with_ping6_command])
1095 elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1096 egrep -i "^round-trip|^rtt" >/dev/null
1098 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1099 AC_MSG_RESULT([$with_ping6_command])
1101 elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1102 egrep -i "^round-trip|^rtt" >/dev/null
1104 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1105 AC_MSG_RESULT([$with_ping6_command])
1107 elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1108 egrep -i "^round-trip|^rtt" >/dev/null
1110 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1111 ac_cv_ping6_packets_first=yes
1112 AC_MSG_RESULT([$with_ping_command])
1114 elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1115 egrep -i "^round-trip|^rtt" >/dev/null
1117 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1118 ac_cv_ping6_packets_first=yes
1119 AC_MSG_RESULT([$with_ping6_command])
1125 if test "x$with_ping6_command" != "x"; then
1126 AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1127 [path and args for ICMPv6 ping command])
1129 AC_MSG_RESULT([none])
1132 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1133 AC_DEFINE(PING6_PACKETS_FIRST,1,
1134 [Define if packet count must precede host])
1139 AC_ARG_WITH(nslookup_command,
1140 ACX_HELP_STRING([--with-nslookup-command=PATH],
1141 [sets path to nslookup executable]),
1142 ac_cv_nslookup_command=$withval)
1143 if test -n "$ac_cv_nslookup_command"; then
1144 AC_MSG_NOTICE([Using specific nslookup at $ac_cv_nslookup_command])
1146 AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1147 if test -n "$PATH_TO_NSLOOKUP"
1149 AC_MSG_CHECKING(for nslookup syntax)
1150 if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1152 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1153 AC_MSG_RESULT([$ac_cv_nslookup_command])
1156 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1157 AC_MSG_RESULT([$ac_cv_nslookup_command])
1161 AC_MSG_WARN([nslookup command not found])
1165 if test -n "$ac_cv_nslookup_command"; then
1166 EXTRAS="$EXTRAS check_dns"
1167 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
1170 AC_MSG_CHECKING([for number of cpus])
1171 AC_TRY_COMPILE([#include <unistd.h>],
1172 [sysconf(_SC_NPROCESSORS_CONF) > 0;],
1173 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus])
1174 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1175 AC_MSG_RESULT([cannot calculate])
1178 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1179 AC_ARG_WITH(uptime_command,
1180 ACX_HELP_STRING([--with-uptime-command=PATH],
1181 [sets path to uptime]), PATH_TO_UPTIME=$withval)
1182 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1184 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1185 AC_ARG_WITH(rpcinfo_command,
1186 ACX_HELP_STRING([--with-rpcinfo-command=PATH],
1187 [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
1188 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1190 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1191 if test -x "$PATH_TO_LMSTAT"
1193 AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1195 AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1198 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1199 AC_ARG_WITH(smbclient_command,
1200 ACX_HELP_STRING([--with-smbclient-command=PATH],
1201 [sets path to smbclient]),
1202 PATH_TO_SMBCLIENT=$withval)
1203 if test -n "$PATH_TO_SMBCLIENT"
1205 AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1207 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1211 AC_PATH_PROG(PATH_TO_WHO,who)
1213 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1215 ac_cv_path_to_who="$PATH_TO_WHO -q"
1217 ac_cv_path_to_who="$PATH_TO_WHO"
1220 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1221 [path and arguments for invoking 'who'])
1223 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1224 AC_ARG_WITH(snmpget_command,
1225 ACX_HELP_STRING([--with-snmpget-command=PATH],
1226 [Path to snmpget command]),
1227 PATH_TO_SNMPGET=$withval)
1228 if test -n "$PATH_TO_SNMPGET"
1230 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1231 EXTRAS="$EXTRAS check_hpjd check_snmp"
1233 AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1236 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1237 AC_ARG_WITH(snmpgetnext_command,
1238 ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
1239 [Path to snmpgetnext command]),
1240 PATH_TO_SNMPGETNEXT=$withval)
1241 if test -n "$PATH_TO_SNMPGETNEXT"
1243 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1246 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
1248 AC_MSG_CHECKING(for Net::SNMP perl module)
1249 AC_MSG_RESULT([found])
1251 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1254 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1255 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1256 AC_ARG_WITH(qstat_command,
1257 ACX_HELP_STRING([--with-qstat-command=PATH],
1258 [Path to qstat command]), PATH_TO_QSTAT=$withval)
1260 if test -x "$PATH_TO_QUAKESTAT"
1262 ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1263 EXTRAS="$EXTRAS check_game"
1265 elif test -n "$PATH_TO_QSTAT"
1267 ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1268 EXTRAS="$EXTRAS check_game"
1270 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1273 if test $ac_cv_path_to_qstat
1275 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1276 [path to qstat/quakestat])
1279 AC_PATH_PROG(PATH_TO_FPING,fping)
1280 AC_ARG_WITH(fping_command,
1281 ACX_HELP_STRING([--with-fping-command=PATH],
1282 [Path to fping command]), PATH_TO_FPING=$withval)
1283 if test -n "$PATH_TO_FPING"
1285 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1286 EXTRAS="$EXTRAS check_fping"
1288 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1291 AC_PATH_PROG(PATH_TO_SSH,ssh)
1292 AC_ARG_WITH(ssh_command,
1293 ACX_HELP_STRING([--with-ssh-command=PATH],
1294 [sets path for ssh]), PATH_TO_SSH=$withval)
1295 if test -n "$PATH_TO_SSH"
1297 AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1298 EXTRAS="$EXTRAS check_by_ssh"
1300 AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1304 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1305 AC_ARG_WITH(mailq_command,
1306 ACX_HELP_STRING([--with-mailq-command=PATH],
1307 [sets path to mailq]), PATH_TO_MAILQ=$withval)
1308 if test -n "$PATH_TO_MAILQ"
1310 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1312 AC_MSG_WARN([Could not find mailq or eqivalent])
1315 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1316 if test -x "$PATH_TO_QMAIL_QSTAT"
1318 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1320 AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1323 dnl SWAP info required is amount allocated/available and amount free
1324 dnl The plugin works through all the swap devices and adds up the total swap
1326 AC_PATH_PROG(PATH_TO_SWAP,swap)
1327 if (test -n "$PATH_TO_SWAP")
1329 AC_MSG_CHECKING([for $PATH_TO_SWAP format])
1330 if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1333 ac_cv_swap_command="$PATH_TO_SWAP -l"
1334 if [$PATH_TO_SWAP -l 2>/dev/null | \
1335 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1338 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
1339 ac_cv_swap_conv=2048
1340 AC_MSG_RESULT([using IRIX format swap])
1342 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1344 ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
1345 ac_cv_swap_conv=2048
1346 AC_MSG_RESULT([using Unixware format swap])
1348 dnl if we don't know what format swap's output is
1349 dnl we might as well pretend we didn't see it
1351 ac_cv_swap_command=""
1354 dnl end if for PATH_TO_SWAP
1357 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1358 if (test -n "$PATH_TO_SWAPINFO")
1360 AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
1361 if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1364 ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1366 if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1368 ac_cv_swap_format=["%*s %f %*d %f"]
1369 ac_cv_swap_conv=1024
1370 AC_MSG_RESULT([using FreeBSD format swapinfo])
1373 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1376 ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
1377 ac_cv_swap_format=["%*s %f %*d %f"]
1378 ac_cv_swap_conv=1024
1379 AC_MSG_RESULT([using HP-UX format swapinfo])
1381 dnl end if for PATH_TO_SWAPINFO
1384 AC_PATH_PROG(PATH_TO_LSPS,lsps)
1385 if (test -n "$PATH_TO_LSPS")
1387 AC_MSG_CHECKING([for $PATH_TO_LSPS format])
1388 if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
1391 ac_cv_swap_command="$PATH_TO_LSPS -a"
1392 ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
1394 AC_MSG_RESULT([using AIX lsps])
1396 dnl end if for PATH_TO_SWAPINFO
1400 dnl test for swapctl system call, both the 2-arg and 3-arg variants
1401 dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
1402 dnl in the various BSD's
1405 AC_CHECK_HEADERS([sys/stat.h sys/param.h])
1406 AC_CHECK_HEADERS([sys/swap.h], [], [], [
1407 #ifdef HAVE_SYS_PARAM_H
1408 #include <sys/param.h>
1411 AC_CHECK_DECLS([swapctl],,,[
1413 #include <sys/types.h>
1414 #include <sys/param.h>
1415 #include <sys/stat.h>
1416 #include <sys/swap.h>
1418 AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
1419 #include <sys/types.h>
1420 #include <sys/param.h>
1421 #include <sys/stat.h>
1422 #include <sys/swap.h>
1424 AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1426 #include <sys/types.h>
1427 #include <sys/param.h>
1428 #include <sys/stat.h>
1429 #include <sys/swap.h>
1432 if test "$ac_cv_have_decl_swapctl" = "yes";
1434 EXTRAS="$EXTRAS check_swap"
1435 AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1436 if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1437 "$ac_cv_type_swapent_t" = "yes";
1439 AC_MSG_RESULT([yes])
1440 ac_cv_check_swap_swapctl_svr4="1";
1441 AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
1442 [Define if 2-argument SVR4 swapctl exists])
1445 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1446 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1448 AC_MSG_RESULT([yes])
1449 AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
1450 [Define if 3-argument BSD swapctl exists])
1455 AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
1456 if test "$ac_cv_check_swap_swapctl_svr4" = "1";
1459 dnl the SVR4 spec returns values in pages
1461 AC_MSG_RESULT([page])
1462 AC_CHECK_DECLS([sysconf])
1463 AC_MSG_CHECKING([for system page size])
1464 if test "$ac_cv_have_decl_sysconf" = "yes";
1466 AC_MSG_RESULT([determined by sysconf(3)])
1467 ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
1469 AC_MSG_WARN([don't know. guessing 4096k])
1474 dnl the BSD spec returns values in blocks
1476 AC_MSG_RESULT([blocks (assuming 512b)])
1477 ac_cv_swap_conv=2048
1479 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1480 [Conversion factor to MB])
1483 dnl end tests for the swapctl system calls
1487 if test "x$ac_cv_have_swap" != "x"
1489 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1490 EXTRAS="$EXTRAS check_swap"
1492 if test "x$ac_cv_swap_command" != "x"
1494 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1495 [Path to swap/swapinfo binary, with any args])
1496 AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1497 [Format string for parsing swap output])
1498 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1499 [Conversion factor to MB])
1502 AC_ARG_WITH(proc-meminfo,
1503 ACX_HELP_STRING([--with-proc-meminfo=PATH],
1504 [path to /proc/meminfo or equivalent]),
1505 ac_cv_proc_meminfo=$withval)
1506 dnl dunno why this does not work below - use hack (kbd)
1507 dnl fine on linux, broken on solaris
1508 dnl if /bin/test -e "/proc/meminfo"
1509 AC_MSG_CHECKING([for /proc/meminfo])
1510 if test -n "$ac_cv_proc_meminfo"; then
1511 AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
1512 elif [cat /proc/meminfo > /dev/null 2>&1]; then
1513 AC_MSG_RESULT([found /proc/meminfo])
1514 ac_cv_proc_meminfo="/proc/meminfo"
1519 if test -n "$ac_cv_proc_meminfo"; then
1520 AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1521 AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
1522 EXTRAS="$EXTRAS check_swap"
1525 AC_PATH_PROG(PATH_TO_DIG,dig)
1526 AC_ARG_WITH(dig_command,
1527 ACX_HELP_STRING([--with-dig-command=PATH],
1528 [Path to dig command]), PATH_TO_DIG=$withval)
1529 if test -n "$PATH_TO_DIG"; then
1530 EXTRAS="$EXTRAS check_dig"
1531 AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1534 AC_PATH_PROG(PATH_TO_APTGET,apt-get)
1535 AC_ARG_WITH(apt-get_command,
1536 ACX_HELP_STRING([--with-apt-get-command=PATH],
1537 [Path to apt-get command]),
1538 with_apt_get_command=$withval,
1539 with_apt_get_command=$PATH_TO_APTGET)
1540 AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
1541 if test -n "$PATH_TO_APTGET" ; then
1542 EXTRAS="$EXTRAS check_apt"
1546 if test -f $srcdir/plugins/check_nt.c ; then
1547 EXTRAS="$EXTRAS check_nt"
1551 dnl used in check_dhcp
1552 AC_CHECK_HEADERS(sys/sockio.h)
1556 AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
1559 AC_DEFINE(__linux__,1,[linux specific code in check_dhcp.c])
1562 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
1565 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
1570 AC_SUBST(EXTRAS_ROOT)
1571 AC_SUBST(EXTRA_NETOBJS)
1574 AM_GNU_GETTEXT([external], [need-ngettext])
1575 AM_GNU_GETTEXT_VERSION(0.15)
1577 dnl Check for Redhat spopen problem
1578 dnl Wierd problem where ECHILD is returned from a wait call in error
1579 dnl Only appears to affect nslookup and dig calls. Only affects redhat around
1580 dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
1581 dnl We patch plugins/popen.c
1582 dnl Need to add smp because uname different on those
1583 dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1584 AC_ARG_ENABLE(redhat-pthread-workaround,
1585 AC_HELP_STRING([--enable-redhat-pthread-workaround],
1586 [force Redhat patch to be applied (default: test system)]),
1587 [ac_cv_enable_redhat_pthread_workaround=$enableval],
1588 [ac_cv_enable_redhat_pthread_workaround=test])
1589 if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
1590 if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
1591 AC_MSG_NOTICE([See http://nagiosplugins.org/faq/compile/configure_appears_to_hang if this next part takes a long time])
1592 AC_MSG_CHECKING(for redhat spopen problem)
1593 ( cd config_test && make && make test ) > /dev/null 2>&1
1594 if test $? -eq 0 ; then
1597 AC_MSG_RESULT(error)
1598 AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
1601 elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
1602 AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
1606 AC_ARG_ENABLE(perl-modules,
1607 AC_HELP_STRING([--enable-perl-modules],
1608 [Enables installation of Nagios::Plugin and its dependencies (default: no)]),
1609 [enable_perl_modules=$enableval],
1610 [enable_perl_modules=no])
1611 if test "$enable_perl_modules" = "yes" ; then
1612 AC_SUBST(PERLMODS_DIR,perlmods)
1615 # From Tap configure
1616 # Checks for libraries
1619 LDFLAGS="$LDFLAGS -pthread"
1623 AC_CHECK_LIB(pthread, main)
1627 dnl External libraries - see ACKNOWLEDGEMENTS
1630 dnl Some helpful common compile errors checked here
1631 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
1632 AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
1641 plugins-root/Makefile
1642 plugins-scripts/Makefile
1643 plugins-scripts/subst
1644 plugins-scripts/utils.pm
1645 plugins-scripts/utils.sh
1654 dnl the ones below that are commented out need to be cleaned up
1655 dnl in the configure code above to use with_foo instead of ac_cv_foo
1656 dnl if we want them to show up here. it'd also make the code cleaner.
1657 dnl i'll get to that on another rainy day :) -sf
1658 ACX_FEATURE([with],[apt-get-command])
1659 dnl ACX_FEATURE([with],[dig-command])
1660 dnl ACX_FEATURE([with],[fping-command])
1661 dnl ACX_FEATURE([with],[mailq-command])
1662 dnl ACX_FEATURE([with],[nslookup-command])
1663 ACX_FEATURE([with],[ping6-command])
1664 ACX_FEATURE([with],[ping-command])
1665 dnl ACX_FEATURE([with],[qstat-command])
1666 dnl ACX_FEATURE([with],[rpcinfo-command])
1667 dnl ACX_FEATURE([with],[smbclient-command])
1668 dnl ACX_FEATURE([with],[snmpget-command])
1669 dnl ACX_FEATURE([with],[snmpgetnext-command])
1670 dnl ACX_FEATURE([with],[ssh-command])
1671 dnl ACX_FEATURE([with],[uptime-command])
1673 dnl ACX_FEATURE([with],[proc-meminfo])
1674 dnl ACX_FEATURE([with],[ps-command])
1675 dnl ACX_FEATURE([with],[ps-format])
1676 dnl ACX_FEATURE([with],[ps-cols])
1677 dnl ACX_FEATURE([with],[ps-varlist])
1679 ACX_FEATURE([with],[ipv6])
1680 ACX_FEATURE([with],[mysql])
1681 ACX_FEATURE([with],[openssl])
1682 ACX_FEATURE([with],[gnutls])
1683 ACX_FEATURE([enable],[extra-opts])
1684 ACX_FEATURE([with],[perl])
1685 ACX_FEATURE([enable],[perl-modules])
1686 ACX_FEATURE([with],[cgiurl])
1687 ACX_FEATURE([with],[trusted-path])
1688 ACX_FEATURE([enable],[libtap])