summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-08-20 21:57:52 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-08-20 21:57:52 +0200
commit1a329f250fa2b462473da4633506908193ee81d6 (patch)
treebf61194926d1c996f8c2815841c6679d2344e3ee /configure.in
parent92849a1a87f2c74a3017b30fec90c46919761f79 (diff)
downloadmonitoring-plugins-1a329f250fa2b462473da4633506908193ee81d6.tar.gz
Check for who(1) only if utmpx(5) isn't available
The who(1) command is only called by check_users if the system doesn't provide an utmpx(5) interface.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in37
1 files changed, 20 insertions, 17 deletions
diff --git a/configure.in b/configure.in
index 529720e7..a157596f 100644
--- a/configure.in
+++ b/configure.in
@@ -316,10 +316,6 @@ AS_IF([test "x$with_ldap" != "xno"], [
316 LIBS="$_SAVEDLIBS" 316 LIBS="$_SAVEDLIBS"
317]) 317])
318 318
319dnl Check for headers used by check_users
320AC_CHECK_HEADERS(utmpx.h)
321AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"])
322
323dnl Check for headers used by check_ide_smart 319dnl Check for headers used by check_ide_smart
324case $host in 320case $host in
325 *linux*) 321 *linux*)
@@ -366,6 +362,26 @@ else
366 AC_SUBST(MYSQLCFLAGS) 362 AC_SUBST(MYSQLCFLAGS)
367fi 363fi
368 364
365dnl Check for headers used by check_users
366AC_CHECK_HEADERS(utmpx.h)
367AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"])
368
369dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface
370if test "$ac_cv_header_utmpx_h" = "no"
371then
372 AC_PATH_PROG(PATH_TO_WHO,who)
373
374 if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
375 then
376 ac_cv_path_to_who="$PATH_TO_WHO -q"
377 else
378 ac_cv_path_to_who="$PATH_TO_WHO"
379 fi
380
381 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
382 [path and arguments for invoking 'who'])
383fi
384
369AC_ARG_WITH([ipv6], 385AC_ARG_WITH([ipv6],
370 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], 386 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
371 [], [with_ipv6=check]) 387 [], [with_ipv6=check])
@@ -1338,19 +1354,6 @@ else
1338 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) 1354 AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
1339fi 1355fi
1340 1356
1341
1342AC_PATH_PROG(PATH_TO_WHO,who)
1343
1344if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
1345then
1346 ac_cv_path_to_who="$PATH_TO_WHO -q"
1347else
1348 ac_cv_path_to_who="$PATH_TO_WHO"
1349fi
1350
1351AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
1352 [path and arguments for invoking 'who'])
1353
1354AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) 1357AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
1355AC_ARG_WITH(snmpget_command, 1358AC_ARG_WITH(snmpget_command,
1356 ACX_HELP_STRING([--with-snmpget-command=PATH], 1359 ACX_HELP_STRING([--with-snmpget-command=PATH],