From 7a5b32624216b9b6e752386b45e6abce5258be8c Mon Sep 17 00:00:00 2001 From: Maria Date: Mon, 11 Jul 2022 16:25:05 -0400 Subject: [PATCH] check_smartmon: init at 1.0.1 --- .../monitoring/nagios/plugins/smartmon.nix | 42 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/servers/monitoring/nagios/plugins/smartmon.nix diff --git a/pkgs/servers/monitoring/nagios/plugins/smartmon.nix b/pkgs/servers/monitoring/nagios/plugins/smartmon.nix new file mode 100644 index 000000000000..42554cfafe99 --- /dev/null +++ b/pkgs/servers/monitoring/nagios/plugins/smartmon.nix @@ -0,0 +1,42 @@ +{ lib +, stdenv +, fetchFromGitHub +, python3 +, smartmontools +}: + +stdenv.mkDerivation rec { + pname = "check_smartmon"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "driehuis"; + repo = "Nagios_check_smartmon"; + rev = version; + sha256 = "tiIeFiHdDgqoeznk9XdCE7owIMnnsQ0fmtj8foFoUD8="; + }; + + buildInputs = [ + (python3.withPackages (pp: [ pp.psutil ])) + smartmontools + ]; + + postPatch = '' + patchShebangs check_smartmon.py + substituteInPlace check_smartmon.py \ + --replace '"/usr/sbin/smartctl"' '"${smartmontools}/bin/smartctl"' + ''; + + installPhase = '' + runHook preInstall + install -Dm 755 check_smartmon.py $out/bin/check_smartmon + runHook postInstall + ''; + + meta = with lib; { + description = "A Nagios-Plugin that uses smartmontools to check disk health status and temperature"; + homepage = "https://github.com/driehuis/Nagios_check_smartmon"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ mariaa144 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 499612fd435d..2a285a853bf9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22742,6 +22742,8 @@ with pkgs; check-openvpn = callPackage ../servers/monitoring/plugins/openvpn.nix { }; + check_smartmon = callPackage ../servers/monitoring/nagios/plugins/smartmon.nix { }; + checkSSLCert = callPackage ../servers/monitoring/nagios/plugins/check_ssl_cert.nix { }; check_systemd = callPackage ../servers/monitoring/nagios/plugins/check_systemd.nix { };