jungle/m/hut/monitoring.nix

67 lines
1.7 KiB
Nix
Raw Normal View History

2023-04-05 17:00:01 +02:00
{ config, lib, ... }:
{
services.grafana = {
enable = true;
2023-05-09 18:53:31 +02:00
settings = {
server = {
domain = "jungle.bsc.es";
root_url = "%(protocol)s://%(domain)s/grafana";
serve_from_sub_path = true;
2023-05-09 18:53:31 +02:00
http_port = 2342;
http_addr = "127.0.0.1";
};
feature_toggles.publicDashboards = true;
2023-04-05 17:00:01 +02:00
};
};
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";
};
2023-04-18 16:03:46 +02:00
# Required to allow the smartctl exporter to read the nvme0 character device,
# see the commit message on:
# https://github.com/NixOS/nixpkgs/commit/12c26aca1fd55ab99f831bedc865a626eee39f80
services.udev.extraRules = ''
SUBSYSTEM=="nvme", KERNEL=="nvme[0-9]*", GROUP="disk"
'';
2023-04-05 17:00:01 +02:00
services.prometheus = {
exporters = {
ipmi.enable = true;
ipmi.group = "root";
ipmi.user = "root";
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
2023-04-18 16:03:46 +02:00
smartctl.enable = true;
2023-04-05 17:00:01 +02:00
};
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"
2023-04-06 13:56:52 +02:00
"127.0.0.1:9252"
2023-04-18 16:03:46 +02:00
"127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"
2023-04-05 17:00:01 +02:00
];
}];
}
];
};
}