waffentrager: monitoring
This commit is contained in:
parent
b9f78639c8
commit
f892292aa0
|
@ -11,7 +11,7 @@
|
|||
./samba.nix
|
||||
./syncthing.nix
|
||||
./jellyfin.nix
|
||||
./grafana.nix
|
||||
./monitoring.nix
|
||||
./auth
|
||||
];
|
||||
waffentragerService.elements.enable = true;
|
||||
|
@ -23,5 +23,5 @@
|
|||
waffentragerService.samba.enable = true;
|
||||
waffentragerService.jellyfin.enable = true;
|
||||
waffentragerService.syncthing.enable = true;
|
||||
waffentragerService.grafana.enable = false;
|
||||
waffentragerService.monitoring.enable = true;
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
{ materusArg, config, lib, ... }:
|
||||
{
|
||||
options.waffentragerService.grafana.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable grafana";
|
||||
options.waffentragerService.monitoring.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable monitoring";
|
||||
config =
|
||||
let
|
||||
cfg = config.waffentragerService.grafana;
|
||||
cfg = config.waffentragerService.monitoring;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
services.grafana = {
|
||||
|
@ -21,7 +21,25 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 3233;
|
||||
globalConfig.scrape_interval = "30s";
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [{
|
||||
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
services.prometheus.exporters.node = {
|
||||
enable = true;
|
||||
port = 3234;
|
||||
enabledCollectors = [ "systemd" ];
|
||||
extraFlags = [ "--collector.ethtool" "--collector.softirqs" "--collector.tcpstat" "--collector.wifi" ];
|
||||
};
|
||||
services.nginx.virtualHosts."watchman.materus.pl" = {
|
||||
addSSL = true;
|
||||
sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem";
|
Loading…
Reference in New Issue