diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-20 21:57:52 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-20 21:57:52 +0200 |
commit | 1a329f250fa2b462473da4633506908193ee81d6 (patch) | |
tree | bf61194926d1c996f8c2815841c6679d2344e3ee /configure.in | |
parent | 92849a1a87f2c74a3017b30fec90c46919761f79 (diff) | |
download | monitoring-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.in | 37 |
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"], [ LIBS="$_SAVEDLIBS" ]) -dnl Check for headers used by check_users -AC_CHECK_HEADERS(utmpx.h) -AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"]) - dnl Check for headers used by check_ide_smart case $host in *linux*) @@ -366,6 +362,26 @@ else AC_SUBST(MYSQLCFLAGS) fi +dnl Check for headers used by check_users +AC_CHECK_HEADERS(utmpx.h) +AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"]) + +dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface +if test "$ac_cv_header_utmpx_h" = "no" +then + AC_PATH_PROG(PATH_TO_WHO,who) + + if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] + then + ac_cv_path_to_who="$PATH_TO_WHO -q" + else + ac_cv_path_to_who="$PATH_TO_WHO" + fi + + AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who", + [path and arguments for invoking 'who']) +fi + AC_ARG_WITH([ipv6], [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], [], [with_ipv6=check]) @@ -1338,19 +1354,6 @@ else AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) fi - -AC_PATH_PROG(PATH_TO_WHO,who) - -if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] -then - ac_cv_path_to_who="$PATH_TO_WHO -q" -else - ac_cv_path_to_who="$PATH_TO_WHO" -fi - -AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who", - [path and arguments for invoking 'who']) - AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) AC_ARG_WITH(snmpget_command, ACX_HELP_STRING([--with-snmpget-command=PATH], |