aboutsummaryrefslogtreecommitdiff
path: root/pkgs/probes.nix
blob: 70235d6f60ab99c3c0b8a78741bbaf4346c8b637 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ stdenv, pkgs, lib }:

let
  plugins = [
    "check_disk"
    "check_file_age"
    "check_load"
    "check_log"
    "check_procs"
    "check_swap"
    "check_users"
  ];

in stdenv.mkDerivation {
  name = "local-monitoring-plugins";
  phases = [ "installPhase" ];
  installPhase = ''
    mkdir -p $out/bin
    ${lib.concatMapStringsSep "\n" (p: ''
      cp -a ${pkgs.monitoringPlugins}/libexec/${p} $out/bin/${p}
     '') plugins}
    cp -a '${pkgs.check_mdstat}/bin/'* $out/bin/
    cp -a '${pkgs.check_systemd}/bin/'* $out/bin/
  '';
}