aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs/probes.nix
blob: 650c99651d566b1b3c9f9a51020f749fd65cb123 (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
26
27
28
{ stdenv, pkgs, lib }:

let
  plugins = [
    "check_disk"
    "check_file_age"
    "check_http"
    "check_load"
    "check_log"
    "check_mysql"
    "check_mysql_query"
    "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/
  '';
}