1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION ($Revision$)
4 AC_INIT(nagios-plugins,1.4.13)
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 Add libtap for tests
158 AC_ARG_ENABLE(libtap,
159 AC_HELP_STRING([--enable-libtap],
160 [Enables configuring of libtap in external/tap/. Run "make tap" to compile (default: no)]),
161 [enable_libtap=$enableval],
163 dnl Have to define TAP_DIR so that Makefile can pull it as an extra dist
164 TAP_DIR=external/tap-1.01
166 if test "$enable_libtap" = yes; then
167 dnl Have to have AC_CONFIG_SUBDIRS as a literal
168 AC_CONFIG_SUBDIRS([external/tap-1.01])
169 dnl This is required so that TAP stuff is compiled before the libs and tests
170 dnl A make install will also install the tap library, but as this is a development tool, this should be okay
171 INCLUDE_TAP_DIR=$TAP_DIR
172 AC_SUBST(INCLUDE_TAP_DIR)
173 EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
178 AC_ARG_ENABLE(extra-opts,
179 AC_HELP_STRING([--enable-extra-opts],
180 [Enables parsing of plugins ini config files for extra options (default: no)]),
181 [enable_extra_opts=$enableval],
182 [enable_extra_opts=no])
183 AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
184 if test "$enable_extra_opts" = "yes" ; then
185 AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
186 if test "$enable_libtap" = yes; then
187 EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
192 dnl Check for PostgreSQL libraries
194 _SAVEDCPPFLAGS="$CPPFLAGS"
196 ACX_HELP_STRING([--with-pgsql=DIR],
197 [sets path to pgsql installation]),
199 AC_CHECK_LIB(crypt,main)
200 if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
201 if test -n "$PGSQL"; then
202 LDFLAGS="$LDFLAGS -L$PGSQL/lib"
203 CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
205 AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
206 if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
207 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
208 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
209 AC_CHECK_HEADERS(libpq-fe.h)
210 if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
211 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
212 PGINCLUDE="-I$PGSQL/include"
213 elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
214 PGLIBS="-lpq -lcrypt"
215 PGINCLUDE="-I/usr/include/pgsql"
216 elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
217 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
218 PGINCLUDE="-I/usr/include/postgresql"
219 elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
220 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
221 PGINCLUDE="-I$PGSQL/include"
223 if test -z "$PGINCLUDE"; then
224 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
225 AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
229 EXTRAS="$EXTRAS check_pgsql"
232 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
233 AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
234 AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
237 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
238 AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
241 CPPFLAGS="$_SAVEDCPPFLAGS"
243 dnl Check for radius libraries
245 AC_CHECK_LIB(radiusclient,rc_read_config)
246 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
247 EXTRAS="$EXTRAS check_radius"
248 RADIUSLIBS="-lradiusclient"
251 AC_CHECK_LIB(radiusclient-ng,rc_read_config)
252 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
253 EXTRAS="$EXTRAS check_radius"
254 RADIUSLIBS="-lradiusclient-ng"
257 AC_MSG_WARN([Skipping radius plugin])
258 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
263 dnl Check for LDAP libraries
265 AC_CHECK_LIB(ldap,main,,,-llber)
266 if test "$ac_cv_lib_ldap_main" = "yes"; then
267 LDAPLIBS="-lldap -llber"\
268 LDAPINCLUDE="-I/usr/include/ldap"
270 AC_SUBST(LDAPINCLUDE)
271 AC_CHECK_FUNCS(ldap_set_option)
272 EXTRAS="$EXTRAS check_ldap"
273 AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
275 AC_MSG_WARN([Skipping LDAP plugin])
276 AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
280 dnl Check for headers used by check_ide_smart
281 AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
282 if test "$FOUNDINCLUDE" = "yes" ; then
283 AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
286 if test "$FOUNDINCLUDE" = "yes" ; then
287 EXTRAS="$EXTRAS check_ide_smart"
289 AC_MSG_WARN([Skipping check_ide_smart plugin.])
290 AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.])
293 dnl Check for mysql libraries
295 if test $with_mysql = "no" ; then
296 AC_MSG_WARN([Skipping mysql plugin])
297 AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
299 EXTRAS="$EXTRAS check_mysql check_mysql_query"
300 MYSQLINCLUDE="$np_mysql_include"
301 MYSQLLIBS="$np_mysql_libs"
302 MYSQLCFLAGS="$np_mysql_cflags"
303 AC_SUBST(MYSQLINCLUDE)
305 AC_SUBST(MYSQLCFLAGS)
309 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
310 [], [with_ipv6=check])
312 dnl Check for AF_INET6 support - unistd.h required for Darwin
313 if test "$with_ipv6" != "no"; then
314 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
316 [#ifdef HAVE_UNISTD_H
319 #include <netinet/in.h>
320 #include <sys/socket.h>],
321 [struct sockaddr_in6 sin6;
324 sin6.sin6_family = AF_INET6;
325 sin6.sin6_port = 587;
326 p = &sin6.sin6_addr;],
327 [np_cv_sys_ipv6=yes],
330 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
331 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
333 if test "$np_cv_sys_ipv6" = "yes"; then
334 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
336 with_ipv6="$np_cv_sys_ipv6"
340 dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
341 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
342 if test "$FOUNDINCLUDE" = "no"; then
343 _SAVEDCPPFLAGS="$CPPFLAGS"
344 CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
345 unset ac_cv_header_krb5_h
346 AC_CHECK_HEADERS(krb5.h,
347 KRB5INCLUDE="-I/usr/kerberos/include"
352 if test "$FOUNDINCLUDE" = "no"; then
353 CPPFLAGS="$_SAVEDCPPFLAGS"
356 dnl *** The following block comes from wget configure.ac ***
357 dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto
358 dnl shared library doesn't record its dependency on libdl, so we
359 dnl need to check for it ourselves so we won't fail to link due to a
360 dnl lack of -ldl. Most OSes use dlopen(), but HP-UX uses
362 AC_CHECK_LIB(dl,dlopen)
363 AC_CHECK_LIB(dl,shl_load)
365 dnl openssl detection/configuration
366 if ! test x"$with_openssl" = x"no"; then
367 dnl Check for OpenSSL location if it wasn't already specified
368 if ! test -d "$with_openssl"; then
369 for d in $OPENSSL_DIRS; do
370 if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
376 _SAVEDCPPFLAGS="$CPPFLAGS"
377 _SAVEDLDFLAGS="$LDFLAGS"
378 dnl Check for OpenSSL header files
380 if test x"$with_openssl" != x"/usr" ; then
381 CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
382 LDFLAGS="$LDFLAGS -L$with_openssl/lib"
385 dnl check for openssl in $dir/include/openssl
386 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
387 SSLINCLUDE="-I$with_openssl/include"
390 dnl else check to see if $dir/include has it
391 if test "$FOUNDINCLUDE" = "no"; then
392 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
393 SSLINCLUDE="-I$with_openssl/include"
398 dnl if we didn't find it, reset CPPFLAGS
399 if test "$FOUNDINCLUDE" = "no"; then
400 CPPFLAGS="$_SAVEDCPPFLAGS"
401 LDFLAGS="$_SAVEDLDFLAGS"
404 dnl Check for crypto lib
406 LIBS="-L${with_openssl}/lib"
407 AC_CHECK_LIB(crypto,CRYPTO_lock)
408 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
409 dnl Check for SSL lib
410 AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
414 dnl test headers and libs to decide whether check_http should use SSL
415 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
416 if test "$ac_cv_lib_ssl_main" = "yes"; then
417 if test "$FOUNDINCLUDE" = "yes"; then
425 dnl check for gnutls if openssl isn't found (or is disabled)
426 if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
427 if test ! "$with_gnutls" = ""; then
428 CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
429 elif test ! "$LIBGNUTLS_CONFIG" = ""; then
430 CPPFLAGS="$CPPFLAGS -I`$LIBGNUTLS_CONFIG --prefix`"
432 AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
433 if test "$FOUNDGNUTLS" = "yes"; then
434 AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
437 dnl end check for gnutls
439 if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
440 check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
441 AC_SUBST(check_tcp_ssl)
443 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
444 if test "$FOUNDOPENSSL" = "yes"; then
445 AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
449 AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
454 dnl else deliberately disabled or no ssl support available
455 AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
461 dnl Checks for header files.
466 AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
467 AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
469 dnl Checks for typedefs, structures, and compiler characteristics.
477 AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
478 AC_TRY_LINK([#include <stdarg.h>
479 va_list ap1,ap2;], [va_copy(ap1,ap2);],
480 ac_cv_HAVE_VA_COPY=yes,
481 ac_cv_HAVE_VA_COPY=no)])
482 if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
483 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
485 AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
486 AC_TRY_LINK([#include <stdarg.h>
487 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
488 ac_cv_HAVE___VA_COPY=yes,
489 ac_cv_HAVE___VA_COPY=no)])
490 if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
491 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
495 AC_TRY_COMPILE([#include <sys/time.h>],
497 struct timezone *tz;],
498 AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
499 AC_TRY_COMPILE([#include <sys/time.h>],
502 gettimeofday(tv, tz);],
503 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
504 AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
506 dnl Checks for library functions.
507 AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
510 AC_MSG_CHECKING(return type of socket size)
511 AC_TRY_COMPILE([#include <stdlib.h>
512 #include <sys/types.h>
513 #include <sys/socket.h>],
514 [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
515 ac_cv_socket_size_type=["size_t"]
516 AC_MSG_RESULT(size_t),
517 ac_cv_socket_size_type=["int"]
520 AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
521 [Define type of socket size])
524 dnl #### Process table test
526 AC_PATH_PROG(PATH_TO_PS,ps)
528 AC_MSG_CHECKING(for ps syntax)
529 AC_ARG_WITH(ps_command,
530 ACX_HELP_STRING([--with-ps-command=PATH],
531 [Verbatim command to execute for ps]),
533 AC_ARG_WITH(ps_format,
534 ACX_HELP_STRING([--with-ps-format=FORMAT],
535 [Format string for scanning ps output]),
538 ACX_HELP_STRING([--with-ps-cols=NUM],
539 [Number of columns in ps command]),
541 AC_ARG_WITH(ps_varlist,
542 ACX_HELP_STRING([--with-ps-varlist=LIST],
543 [Variable list for sscanf of 'ps' output]),
546 if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
547 ac_cv_ps_command="$PS_COMMAND"
548 ac_cv_ps_format="$PS_FORMAT"
549 ac_cv_ps_varlist="$PS_VARLIST"
550 ac_cv_ps_cols="$PS_COLS"
551 AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
553 dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
554 elif test "$ac_cv_uname_s" = "SunOS"; then
556 # this is a very, very ugly hack, to hardcode the location for plugins
558 if test "$libexecdir" = '${exec_prefix}/libexec'; then
559 if test "$exec_prefix" = "NONE"; then
560 if test "$prefix" = "NONE"; then
561 pst3="$ac_default_prefix/libexec/pst3"
563 pst3="$prefix/libexec/pst3"
566 pst3="$exec_prefix/libexec/pst3"
569 pst3="$libexecdir/pst3"
571 ac_cv_ps_command="$pst3"
572 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
573 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
575 AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris])
576 if test `isainfo -b` = 64 ; then
579 AC_MSG_NOTICE([using 64bit pst3])
581 AC_MSG_NOTICE([using 32bit pst3])
583 EXTRAS_ROOT="$EXTRAS_ROOT pst3"
585 dnl Removing this for the moment - Ton
586 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
587 dnl Limitation that command name is not available
588 dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
589 dnl egrep -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
591 dnl ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
592 dnl ac_cv_ps_command="/usr/ucb/ps -alxwwn"
593 dnl ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
595 dnl AC_MSG_RESULT([$ac_cv_ps_command])
597 dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
598 dnl so test for this first...
599 elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
600 egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
602 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
603 ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
604 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
606 AC_MSG_RESULT([$ac_cv_ps_command])
608 dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
609 dnl Should also work for FreeBSD 5.2.1 and 5.3
610 dnl STAT UCOMM VSZ RSS USER PPID COMMAND
611 elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
612 egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
614 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
615 ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
616 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
618 AC_MSG_RESULT([$ac_cv_ps_command])
620 dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
621 dnl Limitation: Only first 16 chars returned for ucomm field
622 dnl Must come before ps -weo
623 elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
624 egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
626 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
627 ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
628 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
630 AC_MSG_RESULT([$ac_cv_ps_command])
632 dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
633 elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
634 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
636 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
637 ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
638 ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
640 AC_MSG_RESULT([$ac_cv_ps_command])
643 elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
644 egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
646 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
647 ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
648 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
650 AC_MSG_RESULT([$ac_cv_ps_command])
652 dnl BSD-like mode in RH 6.1
653 elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
654 egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
656 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
657 ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
658 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
660 AC_MSG_RESULT([$ac_cv_ps_command])
663 dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
664 dnl Need the head -1 otherwise test will work because arguments are found
665 elif ps -laxnwww 2>/dev/null | head -1 | \
666 egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
668 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
669 ac_cv_ps_command="$PATH_TO_PS -laxnwww"
670 ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
672 AC_MSG_RESULT([$ac_cv_ps_command])
674 dnl Debian Linux / procps v1.2.9:
675 dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
676 dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
678 elif ps laxnwww 2>/dev/null | \
679 egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
681 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
682 ac_cv_ps_command="$PATH_TO_PS laxnwww"
683 ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
685 AC_MSG_RESULT([$ac_cv_ps_command])
687 dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
688 elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
689 egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
691 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
692 ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
693 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
695 AC_MSG_RESULT([$ac_cv_ps_command])
697 dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
698 dnl Has /usr/bin/ps and /sbin/ps - force sbin version
699 dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
700 dnl of 1500). Will need big changes to check_procs to support
701 elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
702 egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
704 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
705 ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
706 ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
708 AC_MSG_RESULT([$ac_cv_ps_command])
710 elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
711 egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
713 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
714 ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
715 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
717 AC_MSG_RESULT([$ac_cv_ps_command])
719 dnl AIX 4.3.3 and 5.1 do not have an rss field
720 elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
721 egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
723 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
724 ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
725 ac_cv_ps_format="%s %d %d %d %d %f %s %n"
727 AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
730 elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
731 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
733 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
734 ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
735 # There must be no space between the %s and %n due to a wierd problem in sscanf where
736 # it will return %n as longer than the line length
737 ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
739 AC_MSG_RESULT([$ac_cv_ps_command])
741 elif ps -Ao 'status 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 'status uid pid ppid vsz rss pcpu comm args'"
746 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
748 AC_MSG_RESULT([$ac_cv_ps_command])
750 elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
751 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
753 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
754 ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
755 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
757 AC_MSG_RESULT([$ac_cv_ps_command])
759 dnl wonder who takes state instead of stat
760 elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
761 egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
763 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
764 ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
765 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
767 AC_MSG_RESULT([$ac_cv_ps_command])
770 elif ps -el 2>/dev/null | \
771 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
773 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
774 ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
775 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
777 AC_MSG_RESULT([$ac_cv_ps_command])
780 elif ps -el 2>/dev/null | \
781 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
783 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
784 ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
785 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
787 AC_MSG_RESULT([$ac_cv_ps_command])
790 dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
791 dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
792 elif ps -el 2>/dev/null | \
793 egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
795 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
796 ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
797 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
799 AC_MSG_RESULT([$ac_cv_ps_command])
802 elif ps glaxen 2>/dev/null | \
803 egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
805 ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
806 ac_cv_ps_command="$PATH_TO_PS glaxen"
807 ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
809 AC_MSG_RESULT([$ac_cv_ps_command])
812 dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
813 dnl Some truncation will happen in UCOMM column
814 dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
815 dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
816 elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
817 egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
819 ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
820 ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
821 ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
823 AC_MSG_RESULT([$ac_cv_ps_command])
826 elif ps -Al 2>/dev/null | \
827 egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
829 ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
830 ac_cv_ps_command="$PATH_TO_PS -Al"
831 ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
833 AC_MSG_RESULT([$ac_cv_ps_command])
836 AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
839 if test -n "$ac_cv_ps_varlist" ; then
840 AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
841 [Variable list for sscanf of 'ps' output])
842 AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
843 [Verbatim command to execute for ps in check_procs])
844 AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
845 [Format string for scanning ps output in check_procs])
846 AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
847 [Number of columns in ps command])
848 EXTRAS="$EXTRAS check_procs check_nagios"
849 if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
850 AC_DEFINE(PS_USES_PROCETIME,"yes",
851 [Whether the ps utility uses the "procetime" field])
855 AC_PATH_PROG(PATH_TO_PING,ping)
856 AC_PATH_PROG(PATH_TO_PING6,ping6)
858 AC_ARG_WITH(ping_command,
859 ACX_HELP_STRING([--with-ping-command=SYNTAX],
860 [sets syntax for ICMP ping]),
861 with_ping_command=$withval,)
863 AC_MSG_CHECKING(for ICMP ping syntax)
864 ac_cv_ping_packets_first=no
865 ac_cv_ping_has_timeout=no
866 if test -n "$with_ping_command"
868 AC_MSG_RESULT([(command-line) $with_ping_command])
869 if test -n "$ac_cv_ping_packets_first"
871 ac_cv_ping_packets_first=yes
872 ac_cv_ping_has_timeout=yes
875 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
876 $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
877 egrep -i "^round-trip|^rtt" >/dev/null
879 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
880 ac_cv_ping_packets_first=yes
881 AC_MSG_RESULT([$with_ping_command])
883 elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
884 egrep -i "^round-trip|^rtt" >/dev/null
886 with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
887 ac_cv_ping_packets_first=yes
888 ac_cv_ping_has_timeout=yes
889 AC_MSG_RESULT([$with_ping_command])
891 elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
892 egrep -i "^round-trip|^rtt" >/dev/null
894 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
895 ac_cv_ping_packets_first=yes
896 AC_MSG_RESULT([$with_ping_command])
898 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
899 egrep -i "^round-trip|^rtt" >/dev/null
901 with_ping_command="$PATH_TO_PING -n -c %d %s"
902 ac_cv_ping_packets_first=yes
903 AC_MSG_RESULT([$with_ping_command])
905 elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
906 egrep -i "^round-trip|^rtt" >/dev/null
908 with_ping_command="$PATH_TO_PING -n %s -c %d"
909 AC_MSG_RESULT([$with_ping_command])
911 elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
912 egrep -i "^round-trip|^rtt" >/dev/null
914 with_ping_command="$PATH_TO_PING %s -n %d"
915 AC_MSG_RESULT([$with_ping_command])
917 elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
918 egrep -i "^round-trip|^rtt" >/dev/null
920 with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
921 AC_MSG_RESULT([$with_ping_command])
923 elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
924 egrep -i "^round-trip|^rtt" >/dev/null
926 with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
927 AC_MSG_RESULT([$with_ping_command])
929 elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
930 egrep -i "^round-trip|^rtt" >/dev/null
932 with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
933 ac_cv_ping_packets_first=yes
934 AC_MSG_RESULT([$with_ping_command])
936 elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
937 egrep -i "^round-trip|^rtt" >/dev/null
939 with_ping_command="$PATH_TO_PING -n -c %d %s"
940 ac_cv_ping_packets_first=yes
941 AC_MSG_RESULT([$with_ping_command])
944 AC_MSG_WARN([unable to find usable ping syntax])
947 AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
948 [path and args for ICMP ping command])
950 if test "x$ac_cv_ping_packets_first" != "xno"
952 AC_DEFINE(PING_PACKETS_FIRST,1,
953 [Define if packet count must precede host])
956 if test "x$ac_cv_ping_has_timeout" != "xno"
958 AC_DEFINE(PING_HAS_TIMEOUT,1,
959 [Define if ping has its own timeout option that should be set])
962 AC_ARG_WITH(ping6_command,
963 ACX_HELP_STRING([--with-ping6-command=SYNTAX],
964 [sets syntax for ICMPv6 ping]),
965 with_ping6_command=$withval,)
967 if test x"$with_ipv6" != xno ; then
968 AC_MSG_CHECKING(for ICMPv6 ping syntax)
969 ac_cv_ping6_packets_first=no
970 if test -n "$with_ping6_command"
972 AC_MSG_RESULT([(command-line) $with_ping6_command])
973 if test -n "$ac_cv_ping6_packets_first"
975 ac_cv_ping6_packets_first=yes
978 elif test "x$PATH_TO_PING6" != "x"; then
979 if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
980 $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
981 egrep -i "^round-trip|^rtt" >/dev/null
983 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
984 ac_cv_ping6_packets_first=yes
985 AC_MSG_RESULT([$with_ping6_command])
987 elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
988 egrep -i "^round-trip|^rtt" >/dev/null
990 with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
991 ac_cv_ping6_packets_first=yes
992 ac_cv_ping_has_timeout=yes
993 AC_MSG_RESULT([$with_ping6_command])
995 elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
996 egrep -i "^round-trip|^rtt" >/dev/null
998 with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
999 ac_cv_ping6_packets_first=yes
1000 AC_MSG_RESULT([$with_ping6_command])
1002 elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1003 egrep -i "^round-trip|^rtt" >/dev/null
1005 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1006 ac_cv_ping6_packets_first=yes
1007 AC_MSG_RESULT([$with_ping6_command])
1009 elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
1010 egrep -i "^round-trip|^rtt" >/dev/null
1012 with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
1013 AC_MSG_RESULT([$with_ping6_command])
1015 elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
1016 egrep -i "^round-trip|^rtt" >/dev/null
1018 with_ping6_command="$PATH_TO_PING6 %s -n %d"
1019 AC_MSG_RESULT([$with_ping6_command])
1021 elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
1022 egrep -i "^round-trip|^rtt" >/dev/null
1024 with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
1025 AC_MSG_RESULT([$with_ping6_command])
1027 elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1028 egrep -i "^round-trip|^rtt" >/dev/null
1030 with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
1031 AC_MSG_RESULT([$with_ping6_command])
1033 elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
1034 egrep -i "^round-trip|^rtt" >/dev/null
1036 with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
1037 ac_cv_ping6_packets_first=yes
1038 AC_MSG_RESULT([$with_ping_command])
1040 elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
1041 egrep -i "^round-trip|^rtt" >/dev/null
1043 with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
1044 ac_cv_ping6_packets_first=yes
1045 AC_MSG_RESULT([$with_ping6_command])
1049 elif test "x$PATH_TO_PING" != "x"; then
1050 if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
1051 $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1052 egrep -i "^round-trip|^rtt" >/dev/null
1054 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1055 ac_cv_ping6_packets_first=yes
1056 AC_MSG_RESULT([$with_ping6_command])
1058 elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
1059 egrep -i "^round-trip|^rtt" >/dev/null
1061 with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
1062 ac_cv_ping6_packets_first=yes
1063 AC_MSG_RESULT([$with_ping6_command])
1065 elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1066 egrep -i "^round-trip|^rtt" >/dev/null
1068 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1069 ac_cv_ping6_packets_first=yes
1070 AC_MSG_RESULT([$with_ping6_command])
1072 elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
1073 egrep -i "^round-trip|^rtt" >/dev/null
1075 with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
1076 AC_MSG_RESULT([$with_ping6_command])
1078 elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
1079 egrep -i "^round-trip|^rtt" >/dev/null
1081 with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
1082 AC_MSG_RESULT([$with_ping6_command])
1084 elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
1085 egrep -i "^round-trip|^rtt" >/dev/null
1087 with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
1088 AC_MSG_RESULT([$with_ping6_command])
1090 elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
1091 egrep -i "^round-trip|^rtt" >/dev/null
1093 with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
1094 AC_MSG_RESULT([$with_ping6_command])
1096 elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
1097 egrep -i "^round-trip|^rtt" >/dev/null
1099 with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
1100 ac_cv_ping6_packets_first=yes
1101 AC_MSG_RESULT([$with_ping_command])
1103 elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
1104 egrep -i "^round-trip|^rtt" >/dev/null
1106 with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
1107 ac_cv_ping6_packets_first=yes
1108 AC_MSG_RESULT([$with_ping6_command])
1114 if test "x$with_ping6_command" != "x"; then
1115 AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
1116 [path and args for ICMPv6 ping command])
1118 AC_MSG_RESULT([none])
1121 if test "x$ac_cv_ping6_packets_first" != "xno"; then
1122 AC_DEFINE(PING6_PACKETS_FIRST,1,
1123 [Define if packet count must precede host])
1128 AC_ARG_WITH(nslookup_command,
1129 ACX_HELP_STRING([--with-nslookup-command=PATH],
1130 [sets path to nslookup executable]),
1131 ac_cv_nslookup_command=$withval)
1132 if test -n "$ac_cv_nslookup_command"; then
1133 AC_MSG_NOTICE([Using specific nslookup at $ac_cv_nslookup_command])
1135 AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
1136 if test -n "$PATH_TO_NSLOOKUP"
1138 AC_MSG_CHECKING(for nslookup syntax)
1139 if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
1141 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
1142 AC_MSG_RESULT([$ac_cv_nslookup_command])
1145 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
1146 AC_MSG_RESULT([$ac_cv_nslookup_command])
1150 AC_MSG_WARN([nslookup command not found])
1154 if test -n "$ac_cv_nslookup_command"; then
1155 EXTRAS="$EXTRAS check_dns"
1156 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
1159 AC_MSG_CHECKING([for number of cpus])
1160 AC_TRY_COMPILE([#include <unistd.h>],
1161 [sysconf(_SC_NPROCESSORS_CONF) > 0;],
1162 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus])
1163 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1164 AC_MSG_RESULT([cannot calculate])
1167 AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1168 AC_ARG_WITH(uptime_command,
1169 ACX_HELP_STRING([--with-uptime-command=PATH],
1170 [sets path to uptime]), PATH_TO_UPTIME=$withval)
1171 AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
1173 AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
1174 AC_ARG_WITH(rpcinfo_command,
1175 ACX_HELP_STRING([--with-rpcinfo-command=PATH],
1176 [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
1177 AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
1179 AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
1180 if test -x "$PATH_TO_LMSTAT"
1182 AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
1184 AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
1187 AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
1188 AC_ARG_WITH(smbclient_command,
1189 ACX_HELP_STRING([--with-smbclient-command=PATH],
1190 [sets path to smbclient]),
1191 PATH_TO_SMBCLIENT=$withval)
1192 if test -n "$PATH_TO_SMBCLIENT"
1194 AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
1196 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1200 AC_PATH_PROG(PATH_TO_WHO,who)
1202 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1204 ac_cv_path_to_who="$PATH_TO_WHO -q"
1206 ac_cv_path_to_who="$PATH_TO_WHO"
1209 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1210 [path and arguments for invoking 'who'])
1212 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1213 AC_ARG_WITH(snmpget_command,
1214 ACX_HELP_STRING([--with-snmpget-command=PATH],
1215 [Path to snmpget command]),
1216 PATH_TO_SNMPGET=$withval)
1217 if test -n "$PATH_TO_SNMPGET"
1219 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
1220 EXTRAS="$EXTRAS check_hpjd check_snmp"
1222 AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
1225 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
1226 AC_ARG_WITH(snmpgetnext_command,
1227 ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
1228 [Path to snmpgetnext command]),
1229 PATH_TO_SNMPGETNEXT=$withval)
1230 if test -n "$PATH_TO_SNMPGETNEXT"
1232 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
1235 if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
1237 AC_MSG_CHECKING(for Net::SNMP perl module)
1238 AC_MSG_RESULT([found])
1240 AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
1243 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
1244 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
1245 AC_ARG_WITH(qstat_command,
1246 ACX_HELP_STRING([--with-qstat-command=PATH],
1247 [Path to qstat command]), PATH_TO_QSTAT=$withval)
1249 if test -x "$PATH_TO_QUAKESTAT"
1251 ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
1252 EXTRAS="$EXTRAS check_game"
1254 elif test -n "$PATH_TO_QSTAT"
1256 ac_cv_path_to_qstat="$PATH_TO_QSTAT"
1257 EXTRAS="$EXTRAS check_game"
1259 AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
1262 if test $ac_cv_path_to_qstat
1264 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
1265 [path to qstat/quakestat])
1268 AC_PATH_PROG(PATH_TO_FPING,fping)
1269 AC_ARG_WITH(fping_command,
1270 ACX_HELP_STRING([--with-fping-command=PATH],
1271 [Path to fping command]), PATH_TO_FPING=$withval)
1272 if test -n "$PATH_TO_FPING"
1274 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
1275 EXTRAS="$EXTRAS check_fping"
1277 AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
1280 AC_PATH_PROG(PATH_TO_SSH,ssh)
1281 AC_ARG_WITH(ssh_command,
1282 ACX_HELP_STRING([--with-ssh-command=PATH],
1283 [sets path for ssh]), PATH_TO_SSH=$withval)
1284 if test -n "$PATH_TO_SSH"
1286 AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
1287 EXTRAS="$EXTRAS check_by_ssh"
1289 AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
1293 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
1294 AC_ARG_WITH(mailq_command,
1295 ACX_HELP_STRING([--with-mailq-command=PATH],
1296 [sets path to mailq]), PATH_TO_MAILQ=$withval)
1297 if test -n "$PATH_TO_MAILQ"
1299 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
1301 AC_MSG_WARN([Could not find mailq or eqivalent])
1304 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
1305 if test -x "$PATH_TO_QMAIL_QSTAT"
1307 AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
1309 AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
1312 dnl SWAP info required is amount allocated/available and amount free
1313 dnl The plugin works through all the swap devices and adds up the total swap
1315 AC_PATH_PROG(PATH_TO_SWAP,swap)
1316 if (test -n "$PATH_TO_SWAP")
1318 AC_MSG_CHECKING([for $PATH_TO_SWAP format])
1319 if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
1322 ac_cv_swap_command="$PATH_TO_SWAP -l"
1323 if [$PATH_TO_SWAP -l 2>/dev/null | \
1324 egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1327 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
1328 ac_cv_swap_conv=2048
1329 AC_MSG_RESULT([using IRIX format swap])
1331 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1333 ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
1334 ac_cv_swap_conv=2048
1335 AC_MSG_RESULT([using Unixware format swap])
1337 dnl if we don't know what format swap's output is
1338 dnl we might as well pretend we didn't see it
1340 ac_cv_swap_command=""
1343 dnl end if for PATH_TO_SWAP
1346 AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
1347 if (test -n "$PATH_TO_SWAPINFO")
1349 AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
1350 if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
1353 ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
1355 if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1357 ac_cv_swap_format=["%*s %f %*d %f"]
1358 ac_cv_swap_conv=1024
1359 AC_MSG_RESULT([using FreeBSD format swapinfo])
1362 elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
1365 ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
1366 ac_cv_swap_format=["%*s %f %*d %f"]
1367 ac_cv_swap_conv=1024
1368 AC_MSG_RESULT([using HP-UX format swapinfo])
1370 dnl end if for PATH_TO_SWAPINFO
1373 AC_PATH_PROG(PATH_TO_LSPS,lsps)
1374 if (test -n "$PATH_TO_LSPS")
1376 AC_MSG_CHECKING([for $PATH_TO_LSPS format])
1377 if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
1380 ac_cv_swap_command="$PATH_TO_LSPS -a"
1381 ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
1383 AC_MSG_RESULT([using AIX lsps])
1385 dnl end if for PATH_TO_SWAPINFO
1389 dnl test for swapctl system call, both the 2-arg and 3-arg variants
1390 dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
1391 dnl in the various BSD's
1394 AC_CHECK_HEADERS([sys/stat.h sys/param.h])
1395 AC_CHECK_HEADERS([sys/swap.h], [], [], [
1396 #ifdef HAVE_SYS_PARAM_H
1397 #include <sys/param.h>
1400 AC_CHECK_DECLS([swapctl],,,[
1402 #include <sys/types.h>
1403 #include <sys/param.h>
1404 #include <sys/stat.h>
1405 #include <sys/swap.h>
1407 AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
1408 #include <sys/types.h>
1409 #include <sys/param.h>
1410 #include <sys/stat.h>
1411 #include <sys/swap.h>
1413 AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1415 #include <sys/types.h>
1416 #include <sys/param.h>
1417 #include <sys/stat.h>
1418 #include <sys/swap.h>
1421 if test "$ac_cv_have_decl_swapctl" = "yes";
1423 EXTRAS="$EXTRAS check_swap"
1424 AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1425 if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1426 "$ac_cv_type_swapent_t" = "yes";
1428 AC_MSG_RESULT([yes])
1429 ac_cv_check_swap_swapctl_svr4="1";
1430 AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
1431 [Define if 2-argument SVR4 swapctl exists])
1434 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1435 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1437 AC_MSG_RESULT([yes])
1438 AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
1439 [Define if 3-argument BSD swapctl exists])
1444 AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
1445 if test "$ac_cv_check_swap_swapctl_svr4" = "1";
1448 dnl the SVR4 spec returns values in pages
1450 AC_MSG_RESULT([page])
1451 AC_CHECK_DECLS([sysconf])
1452 AC_MSG_CHECKING([for system page size])
1453 if test "$ac_cv_have_decl_sysconf" = "yes";
1455 AC_MSG_RESULT([determined by sysconf(3)])
1456 ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
1458 AC_MSG_WARN([don't know. guessing 4096k])
1463 dnl the BSD spec returns values in blocks
1465 AC_MSG_RESULT([blocks (assuming 512b)])
1466 ac_cv_swap_conv=2048
1468 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1469 [Conversion factor to MB])
1472 dnl end tests for the swapctl system calls
1476 if test "x$ac_cv_have_swap" != "x"
1478 AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
1479 EXTRAS="$EXTRAS check_swap"
1481 if test "x$ac_cv_swap_command" != "x"
1483 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
1484 [Path to swap/swapinfo binary, with any args])
1485 AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
1486 [Format string for parsing swap output])
1487 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1488 [Conversion factor to MB])
1491 AC_ARG_WITH(proc-meminfo,
1492 ACX_HELP_STRING([--with-proc-meminfo=PATH],
1493 [path to /proc/meminfo or equivalent]),
1494 ac_cv_proc_meminfo=$withval)
1495 dnl dunno why this does not work below - use hack (kbd)
1496 dnl fine on linux, broken on solaris
1497 dnl if /bin/test -e "/proc/meminfo"
1498 AC_MSG_CHECKING([for /proc/meminfo])
1499 if test -n "$ac_cv_proc_meminfo"; then
1500 AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
1501 elif [cat /proc/meminfo > /dev/null 2>&1]; then
1502 AC_MSG_RESULT([found /proc/meminfo])
1503 ac_cv_proc_meminfo="/proc/meminfo"
1508 if test -n "$ac_cv_proc_meminfo"; then
1509 AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
1510 AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
1511 EXTRAS="$EXTRAS check_swap"
1514 AC_PATH_PROG(PATH_TO_DIG,dig)
1515 AC_ARG_WITH(dig_command,
1516 ACX_HELP_STRING([--with-dig-command=PATH],
1517 [Path to dig command]), PATH_TO_DIG=$withval)
1518 if test -n "$PATH_TO_DIG"; then
1519 EXTRAS="$EXTRAS check_dig"
1520 AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
1523 AC_PATH_PROG(PATH_TO_APTGET,apt-get)
1524 AC_ARG_WITH(apt-get_command,
1525 ACX_HELP_STRING([--with-apt-get-command=PATH],
1526 [Path to apt-get command]),
1527 with_apt_get_command=$withval,
1528 with_apt_get_command=$PATH_TO_APTGET)
1529 AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
1530 if test -n "$PATH_TO_APTGET" ; then
1531 EXTRAS="$EXTRAS check_apt"
1535 if test -f plugins/check_nt.c ; then
1536 EXTRAS="$EXTRAS check_nt"
1537 elif test -f ../plugins/check_nt.c ; then
1538 EXTRAS="$EXTRAS check_nt"
1542 dnl used in check_dhcp
1543 AC_CHECK_HEADERS(sys/sockio.h)
1547 AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
1550 AC_DEFINE(__linux__,1,[linux specific code in check_dhcp.c])
1553 AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
1556 AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
1561 AC_SUBST(EXTRAS_ROOT)
1562 AC_SUBST(EXTRA_NETOBJS)
1565 AM_GNU_GETTEXT([external], [need-ngettext])
1566 AM_GNU_GETTEXT_VERSION(0.15)
1568 dnl Check for Redhat spopen problem
1569 dnl Wierd problem where ECHILD is returned from a wait call in error
1570 dnl Only appears to affect nslookup and dig calls. Only affects redhat around
1571 dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
1572 dnl We patch plugins/popen.c
1573 dnl Need to add smp because uname different on those
1574 dnl Can force patch to be applied with --enable-redhat-pthread-workaround
1575 AC_ARG_ENABLE(redhat-pthread-workaround,
1576 AC_HELP_STRING([--enable-redhat-pthread-workaround],
1577 [force Redhat patch to be applied (default: test system)]),
1578 [ac_cv_enable_redhat_pthread_workaround=$enableval],
1579 [ac_cv_enable_redhat_pthread_workaround=test])
1580 if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
1581 if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
1582 AC_MSG_NOTICE([See http://nagiosplugins.org/faq/compile/configure_appears_to_hang if this next part takes a long time])
1583 AC_MSG_CHECKING(for redhat spopen problem)
1584 ( cd config_test && make && make test ) > /dev/null 2>&1
1585 if test $? -eq 0 ; then
1588 AC_MSG_RESULT(error)
1589 AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
1592 elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
1593 AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
1597 AC_ARG_ENABLE(perl-modules,
1598 AC_HELP_STRING([--enable-perl-modules],
1599 [Enables installation of Nagios::Plugin and its dependencies (default: no)]),
1600 [enable_perl_modules=$enableval],
1601 [enable_perl_modules=no])
1602 if test "$enable_perl_modules" = "yes" ; then
1603 AC_SUBST(PERLMODS_DIR,perlmods)
1606 dnl External libraries - see ACKNOWLEDGEMENTS
1609 dnl Some helpful common compile errors checked here
1610 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
1611 AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
1619 plugins-root/Makefile
1620 plugins-scripts/Makefile
1621 plugins-scripts/subst
1622 plugins-scripts/utils.pm
1623 plugins-scripts/utils.sh
1632 dnl the ones below that are commented out need to be cleaned up
1633 dnl in the configure code above to use with_foo instead of ac_cv_foo
1634 dnl if we want them to show up here. it'd also make the code cleaner.
1635 dnl i'll get to that on another rainy day :) -sf
1636 ACX_FEATURE([with],[apt-get-command])
1637 dnl ACX_FEATURE([with],[dig-command])
1638 dnl ACX_FEATURE([with],[fping-command])
1639 dnl ACX_FEATURE([with],[mailq-command])
1640 dnl ACX_FEATURE([with],[nslookup-command])
1641 ACX_FEATURE([with],[ping6-command])
1642 ACX_FEATURE([with],[ping-command])
1643 dnl ACX_FEATURE([with],[qstat-command])
1644 dnl ACX_FEATURE([with],[rpcinfo-command])
1645 dnl ACX_FEATURE([with],[smbclient-command])
1646 dnl ACX_FEATURE([with],[snmpget-command])
1647 dnl ACX_FEATURE([with],[snmpgetnext-command])
1648 dnl ACX_FEATURE([with],[ssh-command])
1649 dnl ACX_FEATURE([with],[uptime-command])
1651 dnl ACX_FEATURE([with],[proc-meminfo])
1652 dnl ACX_FEATURE([with],[ps-command])
1653 dnl ACX_FEATURE([with],[ps-format])
1654 dnl ACX_FEATURE([with],[ps-cols])
1655 dnl ACX_FEATURE([with],[ps-varlist])
1657 ACX_FEATURE([with],[ipv6])
1658 ACX_FEATURE([with],[mysql])
1659 ACX_FEATURE([with],[openssl])
1660 ACX_FEATURE([with],[gnutls])
1661 ACX_FEATURE([enable],[extra-opts])
1662 ACX_FEATURE([with],[perl])
1663 ACX_FEATURE([enable],[perl-modules])
1664 ACX_FEATURE([with],[cgiurl])
1665 ACX_FEATURE([with],[trusted-path])