diff options
author | Maria <tuy_mearly@aleeas.com> | 2022-07-15 08:14:10 -0400 |
---|---|---|
committer | Maria <tuy_mearly@aleeas.com> | 2022-07-16 11:08:02 -0400 |
commit | d4a98a7649599992df9c0186da6dfc0f024483d0 (patch) | |
tree | 73f1185716d202ca2b40bb9325138da0a6dd487e /pkgs/servers/monitoring/nagios | |
parent | 7d85a1821ee668bfb0cf43ad542ce80dfd97f36d (diff) |
check-zfs: init at 2.0
Diffstat (limited to 'pkgs/servers/monitoring/nagios')
-rw-r--r-- | pkgs/servers/monitoring/nagios/plugins/zfs.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/servers/monitoring/nagios/plugins/zfs.nix b/pkgs/servers/monitoring/nagios/plugins/zfs.nix new file mode 100644 index 0000000000000..724aa498afb77 --- /dev/null +++ b/pkgs/servers/monitoring/nagios/plugins/zfs.nix @@ -0,0 +1,44 @@ +{ lib +, stdenv +, fetchFromGitHub +, python3 +, zfs +, sudo +}: + +stdenv.mkDerivation rec { + pname = "check_zfs"; + version = "2.0"; + + src = fetchFromGitHub { + owner = "zlacelle"; + repo = "nagios_check_zfs_linux"; + rev = version; + sha256 = "gPLCNt6hp4E94s9/PRgsnBN5XXQQ+s2MGcgRFeknXg4="; + }; + + buildInputs = [ python3 zfs sudo ]; + + postPatch = '' + patchShebangs check_zfs.py + substituteInPlace check_zfs.py \ + --replace "'/usr/bin/sudo'" "'${sudo}/bin/sudo'" \ + --replace "'/sbin/zpool'" "'${zfs}/bin/zpool'" \ + --replace "'/sbin/zfs'" "'${zfs}/bin/zfs'" + ''; + + installPhase = '' + runHook preInstall + + install -Dm 755 check_zfs.py $out/bin/check_zfs + + runHook postInstall + ''; + + meta = with lib; { + description = "Check the health, capacity, fragmentation, and other things for use with Nagios monitoring"; + homepage = "https://github.com/zlacelle/nagios_check_zfs_linux"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ mariaa144 ]; + }; +} |