summaryrefslogtreecommitdiff
path: root/modules/xnet/monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'modules/xnet/monitoring')
-rw-r--r--modules/xnet/monitoring/default.nix37
-rw-r--r--modules/xnet/monitoring/grafana.nix33
2 files changed, 45 insertions, 25 deletions
diff --git a/modules/xnet/monitoring/default.nix b/modules/xnet/monitoring/default.nix
index eed4963..20566d3 100644
--- a/modules/xnet/monitoring/default.nix
+++ b/modules/xnet/monitoring/default.nix
@@ -9,7 +9,6 @@ in
{
imports = [ ./grafana.nix ];
-
config = {
services.prometheus = {
enable = config.xnet.monitoring.hostGrafana;
@@ -19,7 +18,10 @@ in
node = {
enable = true;
openFirewall = true;
- enabledCollectors = [ "processes" "systemd" ];
+ enabledCollectors = [
+ "processes"
+ "systemd"
+ ];
};
# systemd = {
@@ -39,20 +41,29 @@ in
scrapeConfigs =
let
- hosts = [ "iridium" "radon" ];
+ hosts = [
+ "iridium"
+ "radon"
+ ];
in
- [{
- job_name = "node";
- static_configs = [{
- targets = map (h: "${h}:${toString exporters.node.port}") hosts;
- }];
- }
+ [
+ {
+ job_name = "node";
+ static_configs = [
+ {
+ targets = map (h: "${h}:${toString exporters.node.port}") hosts;
+ }
+ ];
+ }
{
job_name = "smartctl";
- static_configs = [{
- targets = map (h: "${h}:${toString exporters.smartctl.port}") hosts;
- }];
- }];
+ static_configs = [
+ {
+ targets = map (h: "${h}:${toString exporters.smartctl.port}") hosts;
+ }
+ ];
+ }
+ ];
};
};
}
diff --git a/modules/xnet/monitoring/grafana.nix b/modules/xnet/monitoring/grafana.nix
index e95318d..a8712f0 100644
--- a/modules/xnet/monitoring/grafana.nix
+++ b/modules/xnet/monitoring/grafana.nix
@@ -1,4 +1,9 @@
-{ config, pkgs, lib, ... }:
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}:
let
inherit (lib) mkOption mkIf types;
@@ -18,18 +23,22 @@ in
config = mkIf hostGrafana {
services.grafana.provision = {
enable = true;
- datasources.settings.datasources = [{
- name = "Prometheus";
- type = "prometheus";
- url = "http://localhost:9090";
- access = "proxy";
- editable = false;
- }];
+ datasources.settings.datasources = [
+ {
+ name = "Prometheus";
+ type = "prometheus";
+ url = "http://localhost:9090";
+ access = "proxy";
+ editable = false;
+ }
+ ];
- dashboards.settings.providers = [{
- name = "Fetched Dashboards";
- options.path = "/etc/grafana/dashboards";
- }];
+ dashboards.settings.providers = [
+ {
+ name = "Fetched Dashboards";
+ options.path = "/etc/grafana/dashboards";
+ }
+ ];
};
environment.etc = {