Add monitoring services

This commit is contained in:
Rodrigo Arias 2023-04-05 17:00:01 +02:00
parent e6c35604bb
commit 60ff89b7cc
2 changed files with 51 additions and 0 deletions

View File

@ -7,6 +7,7 @@
./boot.nix
./fs.nix
./gitlab-runner.nix
./monitoring.nix
./net.nix
./overlays.nix
./slurm.nix

50
monitoring.nix Normal file
View File

@ -0,0 +1,50 @@
{ config, lib, ... }:
{
services.grafana = {
enable = true;
settings.server = {
http_port = 2342;
http_addr = "127.0.0.1";
};
};
services.prometheus = {
enable = true;
port = 9001;
};
systemd.services.prometheus-ipmi-exporter.serviceConfig.DynamicUser = lib.mkForce false;
systemd.services.prometheus-ipmi-exporter.serviceConfig.PrivateDevices = lib.mkForce false;
virtualisation.docker.daemon.settings = {
metrics-addr = "127.0.0.1:9323";
};
services.prometheus = {
exporters = {
ipmi.enable = true;
ipmi.group = "root";
ipmi.user = "root";
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
scrapeConfigs = [
{
job_name = "xeon07";
static_configs = [{
targets = [
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
"127.0.0.1:${toString config.services.prometheus.exporters.ipmi.port}"
"127.0.0.1:9323"
];
}];
}
];
};
}