nixos-servers/system/monitoring.nix

34 lines
827 B
Nix
Raw Normal View History

2024-06-03 01:44:34 +00:00
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
prometheus-node-exporter
prometheus-systemd-exporter
];
systemd.services."node-exporter" = {
enable = true;
unitConfig = {
Description = "Prometheus Node Exporter";
After = [ "network.target" ];
};
serviceConfig = {
ExecStart = "${pkgs.prometheus-node-exporter}/bin/node_exporter";
};
wantedBy = [ "multi-user.target" ];
};
systemd.services."systemd-exporter" = {
enable = true;
unitConfig = {
Description = "Prometheus Systemd Exporter";
After = [ "network.target" ];
};
serviceConfig = {
ExecStart = "${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter";
};
wantedBy = [ "multi-user.target" ];
};
2024-06-03 02:08:16 +00:00
networking.firewall.allowedTCPPorts = [ 9100 9558 ];
2024-06-03 01:44:34 +00:00
}