aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/pkgs/monitoringPlugins/default.nix30
-rw-r--r--modules/pkgs/monitoringPlugins/test-str-format.patch26
2 files changed, 38 insertions, 18 deletions
diff --git a/modules/pkgs/monitoringPlugins/default.nix b/modules/pkgs/monitoringPlugins/default.nix
index d0f554e..16240dc 100644
--- a/modules/pkgs/monitoringPlugins/default.nix
+++ b/modules/pkgs/monitoringPlugins/default.nix
@@ -1,37 +1,31 @@
-{ stdenv, fetchurl
-, autoreconfHook
-, procps, perl
-, fping, openssh, bind
-, mariadb
-, openssl
-}:
+{ stdenv, fetchurl, pkgs }:
stdenv.mkDerivation rec {
- version = "2.1.2";
+ version = "2.2";
name = "monitoring-plugins-${version}";
src = fetchurl {
url = "https://github.com/monitoring-plugins/monitoring-plugins/archive/v${version}.tar.gz";
- sha256 = "0mgs59326yzvx92pdqmn671d40czixd7k60dvsbz89ah2r96vps7";
+ sha256 = "0nq0ilnfmwka5ds9k3bkgqd9238cv1yfyik8xhqbvnkpc3nh1cfk";
};
- buildInputs = [
- autoreconfHook
- procps perl
- fping openssh bind
- mariadb.lib
- openssl
+ buildInputs = with pkgs; [
+ autoreconfHook bind.dnsutils fping libdbi libtap mariadb.lib openldap.dev
+ openssh openssl.dev perl postgresql procps smbclient sudo
];
+ doCheck = false; # tests are broken badly
+
patches = [
./mysql_check_slave.patch
+ ./test-str-format.patch
];
configurePhase = ''
./configure \
--prefix=$out \
--disable-nls \
- --with-ping-command="/var/setuid-wrappers/ping -n -U -w %d -c %d %s" \
- --with-ping6-command="/var/setuid-wrappers/ping6 -n -U -w %d -c %d %s" \
- --with-trusted-path=/var/setuid-wrappers:/run/current-system/sw/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin
+ --with-ping-command="/run/wrappers/bin/ping -n -U -w %d -c %d %s" \
+ --with-ping6-command="/run/wrappers/bin/ping6 -n -U -w %d -c %d %s" \
+ --with-trusted-path=/run/wrappers/bin:/run/current-system/sw/bin:/usr/bin
'';
}
diff --git a/modules/pkgs/monitoringPlugins/test-str-format.patch b/modules/pkgs/monitoringPlugins/test-str-format.patch
new file mode 100644
index 0000000..3311db7
--- /dev/null
+++ b/modules/pkgs/monitoringPlugins/test-str-format.patch
@@ -0,0 +1,26 @@
+Description; fix warning/error
+ error: format not a string literal and no format arguments
+ [-Werror=format-security]
+--- monitoring-plugins-2.2.orig/lib/tests/test_utils.c
++++ monitoring-plugins-2.2/lib/tests/test_utils.c
+@@ -489,16 +489,16 @@ main (int argc, char **argv)
+ int tlen = strlen(testname);
+
+ strcpy(testname+tlen, states[i]);
+- ok(i==mp_translate_state(states[i]), testname);
++ ok(i==mp_translate_state(states[i]), "%s", testname);
+
+ strcpy(testname+tlen, statelower);
+- ok(i==mp_translate_state(statelower), testname);
++ ok(i==mp_translate_state(statelower), "%s", testname);
+
+ strcpy(testname+tlen, stateupper);
+- ok(i==mp_translate_state(stateupper), testname);
++ ok(i==mp_translate_state(stateupper), "%s", testname);
+
+ strcpy(testname+tlen, statenum);
+- ok(i==mp_translate_state(statenum), testname);
++ ok(i==mp_translate_state(statenum), "%s", testname);
+ }
+ ok(ERROR==mp_translate_state("warningfewgw"), "Translate state string with garbage");
+ ok(ERROR==mp_translate_state("00"), "Translate state string: bad numeric string 1");