mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-10 04:49:19 -08:00
services/netdata: Added to prometheus stack
This commit is contained in:
parent
f7f116a9a8
commit
7d701506ce
5 changed files with 48 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ with lib;
|
||||||
../../../services/loki.nix
|
../../../services/loki.nix
|
||||||
../../../services/node-exporter.nix
|
../../../services/node-exporter.nix
|
||||||
../../../services/promtail.nix
|
../../../services/promtail.nix
|
||||||
|
../../../services/netdata.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ in {
|
||||||
../../../services/nginx.nix
|
../../../services/nginx.nix
|
||||||
../../../services/node-exporter.nix
|
../../../services/node-exporter.nix
|
||||||
../../../services/promtail.nix
|
../../../services/promtail.nix
|
||||||
|
../../../services/netdata.nix
|
||||||
./thermal
|
./thermal
|
||||||
./transmission.nix
|
./transmission.nix
|
||||||
./jellyfin.nix
|
./jellyfin.nix
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ with lib;
|
||||||
../../../services/restic.nix
|
../../../services/restic.nix
|
||||||
../../../services/node-exporter.nix
|
../../../services/node-exporter.nix
|
||||||
../../../services/promtail.nix
|
../../../services/promtail.nix
|
||||||
|
../../../services/netdata.nix
|
||||||
|
../../../services/nginx.nix
|
||||||
profiles.gui
|
profiles.gui
|
||||||
profiles.sway
|
profiles.sway
|
||||||
profiles.kat
|
profiles.kat
|
||||||
|
|
|
||||||
24
services/netdata.nix
Normal file
24
services/netdata.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
katnet.private.tcp.ports = [ 19999 ];
|
||||||
|
|
||||||
|
services.netdata = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {#
|
||||||
|
enable = true;
|
||||||
|
virtualHosts = {
|
||||||
|
"${config.networking.hostName}.net.kittywit.ch" = {
|
||||||
|
useACMEHost = "${config.networking.hostName}.net.kittywit.ch";
|
||||||
|
forceSSL = true;
|
||||||
|
locations = {
|
||||||
|
"/netdata" = {
|
||||||
|
proxyPass = "http://[::1]:19999/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,11 @@ let
|
||||||
(filterAttrs
|
(filterAttrs
|
||||||
(_: host: host.config.services.prometheus.exporters.node.enable)
|
(_: host: host.config.services.prometheus.exporters.node.enable)
|
||||||
hosts));
|
hosts));
|
||||||
|
nd_configs =
|
||||||
|
(mapAttrs (hostName: host: host.config.services.netdata)
|
||||||
|
(filterAttrs
|
||||||
|
(_: host: host.config.services.netdata.enable)
|
||||||
|
hosts));
|
||||||
in {
|
in {
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -17,9 +22,23 @@ in {
|
||||||
static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ];}];
|
static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ];}];
|
||||||
}
|
}
|
||||||
] ++ mapAttrsToList (hostName: prom: {
|
] ++ mapAttrsToList (hostName: prom: {
|
||||||
|
job_name = "${hostName}-nd";
|
||||||
|
metrics_path = "/api/v1/allmetrics";
|
||||||
|
honor_labels = true;
|
||||||
|
params = {
|
||||||
|
format = [ "prometheus" ];
|
||||||
|
};
|
||||||
|
static_configs = [{
|
||||||
|
targets = [
|
||||||
|
"${hostName}.net.kittywit.ch:19999"
|
||||||
|
];
|
||||||
|
}];
|
||||||
|
}) nd_configs ++ mapAttrsToList (hostName: prom: {
|
||||||
job_name = hostName;
|
job_name = hostName;
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "${hostName}.net.kittywit.ch:${toString prom.port}" ];
|
targets = [
|
||||||
|
"${hostName}.net.kittywit.ch:${toString prom.port}"
|
||||||
|
];
|
||||||
}];
|
}];
|
||||||
}) prom_configs;
|
}) prom_configs;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue