Add monitoring services
This commit is contained in:
parent
72a10c5ec0
commit
a4d83d6bb8
@ -3,6 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
../../system/monitoring.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Sops stuff
|
# Sops stuff
|
||||||
|
33
system/monitoring.nix
Normal file
33
system/monitoring.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ 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" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 9100 9558 ];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user