mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
grafana: Add crowdsec dashboard
This commit is contained in:
parent
aec201868c
commit
199f0e3eb8
2 changed files with 21 additions and 0 deletions
|
|
@ -67,6 +67,7 @@
|
||||||
nodeExporter = true;
|
nodeExporter = true;
|
||||||
victoriametrics = true;
|
victoriametrics = true;
|
||||||
victorialogs = true;
|
victorialogs = true;
|
||||||
|
crowdsec = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ in
|
||||||
nodeExporter = lib.mkEnableOption "";
|
nodeExporter = lib.mkEnableOption "";
|
||||||
victoriametrics = lib.mkEnableOption "";
|
victoriametrics = lib.mkEnableOption "";
|
||||||
victorialogs = lib.mkEnableOption "";
|
victorialogs = lib.mkEnableOption "";
|
||||||
|
crowdsec = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -125,6 +126,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
|
# https://grafana.com/grafana/dashboards/1860-node-exporter-full/
|
||||||
"grafana-dashboards/node-exporter-full.json" = {
|
"grafana-dashboards/node-exporter-full.json" = {
|
||||||
enable = cfg.dashboards.nodeExporter;
|
enable = cfg.dashboards.nodeExporter;
|
||||||
source = pkgs.fetchurl {
|
source = pkgs.fetchurl {
|
||||||
|
|
@ -133,6 +135,7 @@ in
|
||||||
hash = "sha256-EywgxEayjwNIGDvSmA/S56Ld49qrTSbIYFpeEXBJlTs=";
|
hash = "sha256-EywgxEayjwNIGDvSmA/S56Ld49qrTSbIYFpeEXBJlTs=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# https://grafana.com/grafana/dashboards/10229-victoriametrics-single-node/
|
||||||
"grafana-dashboards/victoriametrics-single-node.json" = {
|
"grafana-dashboards/victoriametrics-single-node.json" = {
|
||||||
enable = cfg.dashboards.victoriametrics;
|
enable = cfg.dashboards.victoriametrics;
|
||||||
source = pkgs.fetchurl {
|
source = pkgs.fetchurl {
|
||||||
|
|
@ -141,6 +144,7 @@ in
|
||||||
hash = "sha256-mwtah8A2w81WZjf5bUXoTJfS1R9UX+tua2PiDrBKJCQ=";
|
hash = "sha256-mwtah8A2w81WZjf5bUXoTJfS1R9UX+tua2PiDrBKJCQ=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# https://grafana.com/grafana/dashboards/22084-victorialogs-single-node/
|
||||||
"grafana-dashboards/victorialogs-single-node.json" = {
|
"grafana-dashboards/victorialogs-single-node.json" = {
|
||||||
enable = cfg.dashboards.victorialogs;
|
enable = cfg.dashboards.victorialogs;
|
||||||
source = pkgs.fetchurl {
|
source = pkgs.fetchurl {
|
||||||
|
|
@ -149,6 +153,22 @@ in
|
||||||
hash = "sha256-/a3Rbp/6oyiLBnQtGupyFZW+fIHQfkyKRRTyfofxVTM=";
|
hash = "sha256-/a3Rbp/6oyiLBnQtGupyFZW+fIHQfkyKRRTyfofxVTM=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# https://grafana.com/grafana/dashboards/19012-crowdsec-details-per-instance/
|
||||||
|
"grafana-dashboards/crowdsec-details-per-instance.json" = {
|
||||||
|
enable = cfg.dashboards.crowdsec;
|
||||||
|
source =
|
||||||
|
pkgs.fetchurl {
|
||||||
|
name = "crowdsec-details-per-instance.json";
|
||||||
|
url = "https://grafana.com/api/dashboards/19012/revisions/1/download";
|
||||||
|
hash = "sha256-VRPWAbPRgp+2pqfmey53wMqaOhLBzXVKUZs/pJ28Ikk=";
|
||||||
|
}
|
||||||
|
|> (
|
||||||
|
src:
|
||||||
|
pkgs.runCommand "crowdsec-details-per-instance-patched.json" { buildInputs = [ pkgs.gnused ]; } ''
|
||||||
|
sed 's/''${DS_PROMETHEUS}/Prometheus/g' ${src} > $out
|
||||||
|
''
|
||||||
|
);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue