forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / servers / monitoring / nagios-plugins / manubulon-snmp-plugins / default.nix
blobedb8f7dca0fa09fb1d4e114ba34de9493226065e
2   fetchFromGitHub,
3   lib,
4   makeWrapper,
5   manubulon-snmp-plugins,
6   nix-update-script,
7   perlPackages,
8   stdenv,
9   testers,
11 stdenv.mkDerivation rec {
12   pname = "manubulon-snmp-plugins";
13   version = "2.1.0-unstable-2024-03-13";
15   src = fetchFromGitHub {
16     owner = "SteScho";
17     repo = "manubulon-snmp";
18     rev = "1a5afb2486802034146277010d956eba9c2ad54b";
19     hash = "sha256-B5CCGMkNv1wGnLQIl0yiGTH2j5MOlj5+MrRqbLNIwhE=";
20   };
22   buildInputs = with perlPackages; [
23     CryptDES
24     CryptRijndael
25     DigestHMAC
26     DigestSHA1
27     GetoptLongDescriptive
28     NetSNMP
29     perl
30   ];
32   nativeBuildInputs = [
33     makeWrapper
34   ];
36   installPhase = ''
37     runHook preInstall
38     mkdir --parents $out/bin
39     install --mode=0755 plugins/*.pl $out/bin
40     runHook postInstall
41   '';
43   postFixup = ''
44     for f in $out/bin/* ; do
45       wrapProgram $f --set PERL5LIB $PERL5LIB --set LC_ALL C
46     done
47   '';
49   passthru = {
50     updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
51     tests.version = testers.testVersion {
52       package = manubulon-snmp-plugins;
53       # Program returns status code 3
54       command = "check_snmp_int.pl --version || true";
55       version = builtins.head (lib.splitString "-" version);
56     };
57   };
59   meta = with lib; {
60     changelog = "https://github.com/SteScho/manubulon-snmp/releases/tag/v${version}";
61     description = "Set of Icinga/Nagios plugins to check hosts and hardware with the SNMP protocol";
62     homepage = "https://github.com/SteScho/manubulon-snmp";
63     license = with licenses; [ gpl2Only ];
64     platforms = platforms.unix;
65     maintainers = with maintainers; [ jwillikers ];
66   };