diff options
Diffstat (limited to 'net-analyzer/nagios-plugins-linux-madrisan')
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/Manifest | 5 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-rename-with-systemd.patch | 86 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-x86-fixes.patch | 148 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/metadata.xml | 2 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-31.ebuild (renamed from net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-30.ebuild) | 0 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-32-r1.ebuild | 55 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-33.ebuild (renamed from net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-29.ebuild) | 8 |
7 files changed, 297 insertions, 7 deletions
diff --git a/net-analyzer/nagios-plugins-linux-madrisan/Manifest b/net-analyzer/nagios-plugins-linux-madrisan/Manifest index 985aed02d71a..b3b7c1490f2a 100644 --- a/net-analyzer/nagios-plugins-linux-madrisan/Manifest +++ b/net-analyzer/nagios-plugins-linux-madrisan/Manifest @@ -1,2 +1,3 @@ -DIST nagios-plugins-linux-madrisan-29.tar.xz 392700 BLAKE2B edc93bfb113cb12ce8a345e38627881decb952cb1e7a948dcdced2aaa9c940956b75a7c8f7ad1b72daac132236ab27762b6f8b14a5098eaac648bafae6dfdb33 SHA512 412464b894fe2a0953e495c7c87604ed6b282f65fd1988043757b162ba4fecf9e8f9740e7e09ec2dad8ba8d80fa928df4d7e644260538117d19776f4883045f6 -DIST nagios-plugins-linux-madrisan-30.tar.xz 391164 BLAKE2B 3b16d0e61a68153fa90bed4c3540d9457546d2448b3b0da2b9313cd99e9b65f44c6f8d52322500570510171a049759ab85855f262d0581c6f926a96fbfe268dd SHA512 c02f81b6bbd4a0453780d9301a5cd1be67b9640e1b75d06c626a433b6e544fb4649c9b14e8e9a2c84dc6917aaf2011fb9a864ef36fef661bbcd673fa00bc5d57 +DIST nagios-plugins-linux-madrisan-31.tar.xz 401556 BLAKE2B 5eca1e96f14b518d9ab5304bb2a54ba47f194bf22cea8445d7fef0769c3b14c800e4ed24c5c0ca32f0daf53aa81a0bd52234478c606a8d2d1a12e96abb90179c SHA512 34d8ae400766e9c7ddd246998f004a50c87ec9ad8dc13deb8e31fc6fcfa07fbe5af2f091d0523b93d06b26438d1a25240bd82d60946e5897bc257fff7c1b73d0 +DIST nagios-plugins-linux-madrisan-32.tar.xz 402976 BLAKE2B ef66934315f3ddbee1a2d84723477773549c9a5ed731853780ef15b9f44ea462256f730f854d517415dce2b944a4bf0abcbfa0623a7a1faffef4b5bbf162af76 SHA512 42392c123961bb17192344f20973a3d26c74aeef112638384d5b7a687e7117a3378d6efdb07ad15a7309f5db621404602e9c2beb0dcc4e207924d0d3a466ab59 +DIST nagios-plugins-linux-madrisan-33.tar.xz 397516 BLAKE2B 39e428d7b44104e01f8101ec33d250b8317c2ab9a5772bd815baf91c14eb1aeffc2aaaec1696e338d9aa31ebd9cb67d10a2049bc78a1bd8fea813761def36d26 SHA512 9b0df712d799ea5ae1eca8135089e41f167446e40416dbfe090ec855476318b26d8fdc3865470bf6cf54e7dcbce483d1f577a886ef35023e983e2508a307df70 diff --git a/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-rename-with-systemd.patch b/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-rename-with-systemd.patch new file mode 100644 index 000000000000..f47319dcd39a --- /dev/null +++ b/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-rename-with-systemd.patch @@ -0,0 +1,86 @@ +https://github.com/madrisan/nagios-plugins-linux/commit/63914284097e3a59e3407bf894376b859a0d1a2e + +From 63914284097e3a59e3407bf894376b859a0d1a2e Mon Sep 17 00:00:00 2001 +From: Davide Madrisan <d.madrisan@proton.me> +Date: Tue, 30 Jan 2024 18:57:16 +0100 +Subject: [PATCH] fix(configure): rename cmdline option --with-systemd + + Rename --with-systemd to --enable-systemd for consistency + with the other optional boolean options. + +Signed-off-by: Davide Madrisan <d.madrisan@proton.me> +--- a/configure.ac ++++ b/configure.ac +@@ -337,7 +337,7 @@ AC_CHECK_DECLS([CPU_ALLOC], [], [], + + dnl Check for libcurl + AC_ARG_ENABLE([libcurl], +- AS_HELP_STRING([--enable-libcurl], [Enable libcurl])) ++ AS_HELP_STRING([--enable-libcurl], [enable libcurl])) + AS_IF([test "x$enable_libcurl" = "xyes"], [ + LIBCURL_CHECK_CONFIG([], [7.40.0], [], + [AC_MSG_ERROR([Missing required libcurl >= 7.40.0])]) +@@ -346,27 +346,9 @@ AS_IF([test "x$enable_libcurl" = "xyes"], [ + AM_CONDITIONAL(HAVE_LIBCURL, [test "$libcurl_cv_lib_curl_usable" = "yes"]) + ], [AM_CONDITIONAL(HAVE_LIBCURL, false)]) + +-dnl Check for systemd-login libraries +-AC_ARG_WITH([systemd], +- AS_HELP_STRING([--without-systemd], [do not build with systemd support]), +- [], [with_systemd=check] +-) +-have_systemd=no +-AS_IF([test "x$with_systemd" != "xno"], [ +- PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no]) +- AS_CASE([$with_systemd:$have_systemd], +- [yes:no], +- [AC_MSG_ERROR([systemd expected but libsystemd not found])], +- [*:yes], +- AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available]) +- AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ]) +- ) +-]) +-AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"]) +- + dnl Check for libvarlink + AC_ARG_ENABLE([libvarlink], +- AS_HELP_STRING([--enable-libvarlink], [Enable libvarlink])) ++ AS_HELP_STRING([--enable-libvarlink], [enable libvarlink])) + AS_IF([test "x$enable_libvarlink" = "xyes"], [ + PKG_CHECK_EXISTS([libvarlink], + [PKG_CHECK_MODULES(LIBVARLINK, [libvarlink >= 18], +@@ -394,6 +376,24 @@ AS_IF([test "x$enable_libprocps" = "xyes"], [ + ]) + AM_CONDITIONAL(HAVE_LIBPROCPS, [test "$have_libprocps" = "yes"]) + ++dnl Check for systemd-login libraries ++AC_ARG_ENABLE([systemd], ++ AS_HELP_STRING([--enable-systemd], [enable systemd related features]), ++ [], [enable_systemd=check] ++) ++have_systemd=no ++AS_IF([test "x$enable_systemd" != "xno"], [ ++ PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no]) ++ AS_CASE([$enable_systemd:$have_systemd], ++ [yes:no], ++ [AC_MSG_ERROR([systemd expected but libsystemd not found])], ++ [*:yes], ++ AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available]) ++ AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted]) ++ ) ++]) ++AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"]) ++ + dnl Add the option '--with-proc-meminfo=PATH' + AC_ARG_WITH(proc-meminfo, + AS_HELP_STRING([--with-proc-meminfo=PATH], +@@ -604,3 +604,9 @@ if test "$have_libvarlink" = "yes"; then + echo " VARLINK_ADDRESS = $VARLINK_ADDRESS" + echo + fi ++ ++if test "$have_systemd" = "yes"; then ++ echo "Optional systemd library support is enabled:" ++ echo " SYSTEMD_CFLAGS = $SYSTEMD_CFLAGS" ++ echo " SYSTEMD_LIBS = $SYSTEMD_LIBS" ++fi diff --git a/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-x86-fixes.patch b/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-x86-fixes.patch new file mode 100644 index 000000000000..657cd458f06e --- /dev/null +++ b/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-32-x86-fixes.patch @@ -0,0 +1,148 @@ +https://github.com/madrisan/nagios-plugins-linux/pull/146 + +From d09bfd1b3974743af4b719629f59b5b96e1393a1 Mon Sep 17 00:00:00 2001 +From: Davide Madrisan <d.madrisan@proton.me> +Date: Wed, 27 Mar 2024 09:29:59 +0100 +Subject: [PATCH 1/3] fix: size_t variables on 32 and 64 bits arch have + different type + +Fix the following warning on 32-bits architectures: + + In file included from ../lib/container_docker_count.c:44, + from tslibcontainer_docker_count.c:33: + ../lib/container_docker_count.c: In function 'docker_running_containers': + ../include/logging.h:28:44: warning: format '%lu' expects argument of type 'long unsigned int', + but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=] + 28 | # define dbg(format, ...) fprintf (stdout, "DEBUG: " format, ##__VA_ARGS__) + | ^~~~~~~~~ + ../lib/container_docker_count.c:213:3: note: in expansion of macro 'dbg' + 213 | dbg ("%lu bytes retrieved\n", chunk.size); + | ^~~ + +Signed-off-by: Davide Madrisan <d.madrisan@proton.me> +--- a/lib/container_docker_count.c ++++ b/lib/container_docker_count.c +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: GPL-3.0-or-later + /* + * License: GPLv3+ +- * Copyright (c) 2018 Davide Madrisan <davide.madrisan@gmail.com> ++ * Copyright (c) 2018,2024 Davide Madrisan <davide.madrisan@gmail.com> + * + * A library for checking for Docker exposed metrics. + * +@@ -210,7 +210,7 @@ docker_running_containers (unsigned int *count, const char *image, + #endif /* NPL_TESTING */ + + assert (chunk.memory); +- dbg ("%lu bytes retrieved\n", chunk.size); ++ dbg ("%zu bytes retrieved\n", chunk.size); + dbg ("json data: %s", chunk.memory); + + hashtable = docker_json_parser (chunk.memory, "Image", 1); + +From 4574e9ed77ebda062279622bb3d8678fa983d272 Mon Sep 17 00:00:00 2001 +From: Davide Madrisan <d.madrisan@proton.me> +Date: Wed, 27 Mar 2024 17:36:04 +0100 +Subject: [PATCH 2/3] fix: workaround for a round issue on 32 bits + +On Gentoo Base System release 2.14 for 32-bits + + (unsigned long)(6.26*100) = 625 + +So the test fails. +As a workaround modify the data file used by the test. + +Signed-off-by: Davide Madrisan <d.madrisan@proton.me> +--- a/tests/ts_procpressurecpu.data ++++ b/tests/ts_procpressurecpu.data +@@ -1 +1 @@ +-some avg10=7.48 avg60=6.26 avg300=6.66 total=200932088 ++some avg10=7.48 avg60=6.25 avg300=6.66 total=200932088 +--- a/tests/tslibpressure.c ++++ b/tests/tslibpressure.c +@@ -103,7 +103,7 @@ mymain (void) + /* we multiply by 100 the averages to somewhat transform + * the double values into integer ones */ + DO_TEST ("cpu some avg10", psi_oneline->avg10 * 100, 748ULL); +- DO_TEST ("cpu some avg60", psi_oneline->avg60 * 100, 626ULL); ++ DO_TEST ("cpu some avg60", psi_oneline->avg60 * 100, 625ULL); + DO_TEST ("cpu some avg300", psi_oneline->avg300 * 100, 666ULL); + DO_TEST ("cpu single total", psi_oneline->total, 200932088ULL); + + +From c90afc02705fd6c32a6764741616b4e17688117b Mon Sep 17 00:00:00 2001 +From: Davide Madrisan <d.madrisan@proton.me> +Date: Wed, 27 Mar 2024 21:06:25 +0100 +Subject: [PATCH 3/3] fix: fix test tslibxstrton_sizetollint on 32-bit arch + +Fix the following errors: + + 1) check function sizetollint with arg 1024b ... OK + 2) check function sizetollint with arg 8k ... OK + 3) check function sizetollint with arg 50m ... OK + 4) check function sizetollint with arg 2g ... OK + 5) check function sizetollint with arg 3t ... FAILED + 6) check function sizetollint with arg 2p ... FAILED + 7) check function sizetollint with arg 1024B ... OK + 8) check function sizetollint with arg 8K ... OK + 9) check function sizetollint with arg 50M ... OK + 10) check function sizetollint with arg 2G ... OK + 11) check function sizetollint with arg 3T ... FAILED + 12) check function sizetollint with arg 2P ... FAILED + +The long int is not large enough on 32-bit architectures. + +Signed-off-by: Davide Madrisan <d.madrisan@proton.me> +--- a/tests/tslibxstrton_sizetoint64.c ++++ b/tests/tslibxstrton_sizetoint64.c +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: GPL-3.0-or-later + /* + * License: GPLv3+ +- * Copyright (c) 2022 Davide Madrisan <davide.madrisan@gmail.com> ++ * Copyright (c) 2022,2024 Davide Madrisan <davide.madrisan@gmail.com> + * + * Unit test for lib/xstrton.c + * +@@ -29,11 +29,11 @@ + typedef struct test_data + { + char *size; +- int64_t expect_value; ++ long long int expect_value; + } test_data; + + static int +-test_sizetoint64 (const void *tdata) ++test_sizetollint (const void *tdata) + { + const struct test_data *data = tdata; + long long int result; +@@ -57,19 +57,19 @@ mymain (void) + .size = SIZE, \ + .expect_value = EXPECT_VALUE, \ + }; \ +- if (test_run("check function sizetoint64 with arg " SIZE, \ +- test_sizetoint64, (&data)) < 0) \ ++ if (test_run("check function sizetollint with arg " SIZE, \ ++ test_sizetollint, (&data)) < 0) \ + ret = -1; \ + } \ + while (0) + + /* test the function sizetoint64() */ + +-#define ONE_KILOBYTE 1000UL +-#define ONE_MEGABYTE (1000UL * ONE_KILOBYTE) +-#define ONE_GIGABYTE (1000UL * ONE_MEGABYTE) +-#define ONE_TERABYTE (1000UL * ONE_GIGABYTE) +-#define ONE_PETABYTE (1000UL * ONE_TERABYTE) ++#define ONE_KILOBYTE 1000ULL ++#define ONE_MEGABYTE (1000ULL * ONE_KILOBYTE) ++#define ONE_GIGABYTE (1000ULL * ONE_MEGABYTE) ++#define ONE_TERABYTE (1000ULL * ONE_GIGABYTE) ++#define ONE_PETABYTE (1000ULL * ONE_TERABYTE) + + DO_TEST ("1024b", 1024); + DO_TEST ("8k", 8 * ONE_KILOBYTE); diff --git a/net-analyzer/nagios-plugins-linux-madrisan/metadata.xml b/net-analyzer/nagios-plugins-linux-madrisan/metadata.xml index c214125e5675..e1a109026d7c 100644 --- a/net-analyzer/nagios-plugins-linux-madrisan/metadata.xml +++ b/net-analyzer/nagios-plugins-linux-madrisan/metadata.xml @@ -6,7 +6,7 @@ <name>Louis Sautier</name> </maintainer> <use> - <flag name="curl">Build check_docker which requires <pkg>net-misc/curl</pkg></flag> + <flag name="curl">Build check_container which requires <pkg>net-misc/curl</pkg></flag> <flag name="varlink">Build check_podman which requires <pkg>dev-libs/libvarlink</pkg></flag> </use> <upstream> diff --git a/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-30.ebuild b/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-31.ebuild index 6e71445b286d..6e71445b286d 100644 --- a/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-30.ebuild +++ b/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-31.ebuild diff --git a/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-32-r1.ebuild b/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-32-r1.ebuild new file mode 100644 index 000000000000..bcd369b7e003 --- /dev/null +++ b/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-32-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +MY_PN="nagios-plugins-linux" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="Additional and alternative Nagios plugins for Linux" +HOMEPAGE="https://github.com/madrisan/nagios-plugins-linux" +SRC_URI="https://github.com/madrisan/${MY_PN}/releases/download/v${PV}/${MY_P}.tar.xz -> ${P}.tar.xz" +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="curl systemd varlink" + +DEPEND=" + curl? ( net-misc/curl:0= ) + systemd? ( sys-apps/systemd:= ) + varlink? ( dev-libs/libvarlink:= ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-rename-with-systemd.patch" + "${FILESDIR}/${P}-x86-fixes.patch" +) + +src_prepare() { + default + # Avoid collision with net-analyzer/monitoring-plugins + # and net-analyzer/nagios-plugins + sed -ri "s/check_(load|swap|uptime|users)/&_madrisan/" plugins/Makefile.am || die + eautoreconf +} + +src_configure() { + local myconf=( + --libexecdir="${EPREFIX}/usr/$(get_libdir)/nagios/plugins" + # Most options are already defaults for Gentoo + --disable-hardening + $(use_enable curl libcurl) + $(use_enable systemd) + $(use_enable varlink libvarlink) + ) + econf "${myconf[@]}" +} + +src_test() { + emake check VERBOSE=1 +} diff --git a/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-29.ebuild b/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-33.ebuild index 7d39abb43437..4e7690db9073 100644 --- a/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-29.ebuild +++ b/net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-33.ebuild @@ -1,4 +1,4 @@ -# Copyright 2021 Gentoo Authors +# Copyright 2022-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -16,11 +16,11 @@ S="${WORKDIR}/${MY_P}" LICENSE="GPL-3+" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="curl varlink" +IUSE="curl systemd" DEPEND=" curl? ( net-misc/curl:0= ) - varlink? ( dev-libs/libvarlink:= ) + systemd? ( sys-apps/systemd:= ) " RDEPEND="${DEPEND}" @@ -38,7 +38,7 @@ src_configure() { # Most options are already defaults for Gentoo --disable-hardening $(use_enable curl libcurl) - $(use_enable varlink libvarlink) + $(use_enable systemd) ) econf "${myconf[@]}" } |