From 59e0a258f9c0f393bf29cced1f35743f74e7b10c Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:57:44 +0100 Subject: Migrate disk tests from lib, tool --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 204fc6e3..fdc9b699 100644 --- a/configure.ac +++ b/configure.ac @@ -181,10 +181,10 @@ fi # Finally, define tests if we use libtap if test "$enable_libtap" = "yes" ; then - EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64" + EXTRA_TEST="test_utils test_tcp test_cmd test_base64" AC_SUBST(EXTRA_TEST) - EXTRA_PLUGIN_TESTS="tests/test_check_swap" + EXTRA_PLUGIN_TESTS="tests/test_check_swap tests/test_check_disk" AC_SUBST(EXTRA_PLUGIN_TESTS) fi -- cgit v1.2.3-74-g34f1 From 1fb9300a2f10d5c649df484e1b8d7550f9a5f846 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 7 May 2025 13:17:47 +1000 Subject: Remove un-needed flags --- configure.ac | 7 ------- plugins/check_fping.c | 42 ------------------------------------------ 2 files changed, 49 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index fdc9b699..bd3de196 100644 --- a/configure.ac +++ b/configure.ac @@ -1524,17 +1524,10 @@ AC_PATH_PROG(PATH_TO_FPING6,fping6) AC_ARG_WITH(fping_command, ACX_HELP_STRING([--with-fping-command=PATH], [Path to fping command]), PATH_TO_FPING=$withval) -AC_ARG_WITH(fping6_command, - ACX_HELP_STRING([--with-fping6-command=PATH], - [Path to fping6 command]), PATH_TO_FPING6=$withval) - if test -n "$PATH_TO_FPING" then AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) EXTRAS="$EXTRAS check_fping\$(EXEEXT)" - if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then - AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6]) - fi else AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) fi diff --git a/plugins/check_fping.c b/plugins/check_fping.c index 9dadcec7..e05056b2 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c @@ -82,28 +82,8 @@ int main(int argc, char **argv) { char *fping_prog = NULL; /* First determine if the target is dualstack or ipv6 only. */ -#ifdef USE_IPV6 bool server_is_inet6_addr = is_inet6_addr(server); -#else - bool server_is_inet6_addr = false; -#endif - /* PATH_TO_FPING6 implies USE_IPV6 */ -#ifdef PATH_TO_FPING6 - /* - * If the user requested -6 OR the user made no assertion and the address is v6 or dualstack - * -> we use ipv6 - * If the user requested -4 OR the user made no assertion and the address is v4 ONLY - * -> we use ipv4 - */ - if (address_family == AF_INET6 || (address_family == AF_UNSPEC && server_is_inet6_addr)) { - fping_prog = strdup(PATH_TO_FPING6); - } else { - xasprintf(&option_string, "%s-4 ", option_string); - fping_prog = strdup(PATH_TO_FPING); - } -#else -#ifdef USE_IPV6 /* * If the user requested -6 OR the user made no assertion and the address is v6 or dualstack * -> we use ipv6 @@ -115,25 +95,7 @@ int main(int argc, char **argv) { } else { xasprintf(&option_string, "%s-4 ", option_string); } -#else - /* - * If the user requested -6 - * -> warn that v6 is not available - * -> we use ipv4 - */ - if (address_family == AF_INET6) { - usage4(_("IPv6 support not available")); - } - /* - * Note here we still have to call with -4, else in the case of a dual stacked target - * we could potentially silently use ipv6 despite having just warned that it is not available - */ - xasprintf(&option_string, "%s-4 ", option_string); - /* end USE_IPV6 */ -#endif fping_prog = strdup(PATH_TO_FPING); - /* end PATH_TO_FPING6 */ -#endif /* compose the command */ if (config.target_timeout) { @@ -385,11 +347,7 @@ check_fping_config_wrapper process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': /* IPv6 only */ -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage(_("IPv6 support not available\n")); -#endif break; case 'c': get_threshold(optarg, rv); -- cgit v1.2.3-74-g34f1 From 1187374e745af310a2e346ab1df5250d07c65a69 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle Date: Wed, 11 Jun 2025 13:11:04 +0200 Subject: Remove unused FPING6 variable --- configure.ac | 1 - 1 file changed, 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index bd3de196..ae704361 100644 --- a/configure.ac +++ b/configure.ac @@ -1519,7 +1519,6 @@ then fi AC_PATH_PROG(PATH_TO_FPING,fping) -AC_PATH_PROG(PATH_TO_FPING6,fping6) AC_ARG_WITH(fping_command, ACX_HELP_STRING([--with-fping-command=PATH], -- cgit v1.2.3-74-g34f1 From 88683af1da8baae6b252795ab5d85a48e9cd3e63 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle Date: Wed, 11 Jun 2025 17:09:27 +0200 Subject: Implement autoconf logic for fping version detection --- configure.ac | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ae704361..bec50cb4 100644 --- a/configure.ac +++ b/configure.ac @@ -1523,10 +1523,44 @@ AC_PATH_PROG(PATH_TO_FPING,fping) AC_ARG_WITH(fping_command, ACX_HELP_STRING([--with-fping-command=PATH], [Path to fping command]), PATH_TO_FPING=$withval) -if test -n "$PATH_TO_FPING" -then +if test -n "$PATH_TO_FPING"; then AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping]) EXTRAS="$EXTRAS check_fping\$(EXEEXT)" + + if test -z "$($PATH_TO_FPING --version)" ; then + AC_MSG_NOTICE([failed to get version of fping]) + else + FPING_MAJOR_VERSION="$($PATH_TO_FPING --version | sed 's/.*fping: Version //' | sed 's/\..*//')" + FPING_MINOR_VERSION="$($PATH_TO_FPING --version | sed 's/.*fping: Version //' | sed 's/.*\.//')" + + if test $FPING_MAJOR_VERSION -eq 5 ; then + if test $FPING_MINOR_VERSION -ge 3 ; then + AC_DEFINE(FPING_VERSION_5_3_OR_HIGHER, "true", [fping is of version 5.3 or higher]) + AC_MSG_NOTICE([fping is of version 5.3 or higher]) + AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher]) + AC_MSG_NOTICE([fping is of version 5.2 or higher]) + elif test $FPING_MINOR_VERSION -ge 2 ; then + AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher]) + AC_MSG_NOTICE([fping is of version 5.2 or higher]) + else + AC_MSG_NOTICE([fping is of a version lower then 5.2]) + fi + + elif $FPING_MAJOR_VERSION > 5 ; then + AC_DEFINE(FPING_VERSION_5_2_OR_HIGHER, "true", [fping is of version 5.2 or higher]) + AC_MSG_NOTICE([fping is of version 5.2 or higher]) + AC_DEFINE(FPING_VERSION_5_3_OR_HIGHER, "true", [fping is of version 5.2 or higher]) + AC_MSG_NOTICE([fping is of version 5.3 or higher]) + fi + + if test "`fping --version | sed 's/.*fping: Version //'`" = "5.2" ; then + AC_DEFINE(FPING_VERSION, "5.2", [the version of fping available]) + AC_MSG_NOTICE([fping version: 5.2]) + elif test "`fping --version | sed 's/.*fping: Version //'`" = "5.3"; then + AC_DEFINE(FPING_VERSION, "5.3", [the version of fping available]) + AC_MSG_NOTICE([fping version: 5.3]) + fi + fi else AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin]) fi -- cgit v1.2.3-74-g34f1