Original commit
This commit is contained in:
commit
cc74263a3b
26 changed files with 3052 additions and 0 deletions
70
modules/servermodules/grafana/grafana.nix
Normal file
70
modules/servermodules/grafana/grafana.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
# Listening Address
|
||||
http_addr = "127.0.0.1";
|
||||
# and Port
|
||||
http_port = 3000;
|
||||
# Grafana needs to know on which domain and URL it's running
|
||||
domain = "grafana.maxiemgeldhof.com";
|
||||
};
|
||||
};
|
||||
provision.datasources.path = ./provision;
|
||||
provision.dashboards.settings = {
|
||||
apiVersion = 1;
|
||||
|
||||
providers = [
|
||||
{
|
||||
name = "default";
|
||||
options.path = ./dashboards;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.prometheus.exporters.node = {
|
||||
enable = true;
|
||||
port = 9000;
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/monitoring/prometheus/exporters.nix
|
||||
enabledCollectors = [ "systemd" ];
|
||||
# /nix/store/zgsw0yx18v10xa58psanfabmg95nl2bb-node_exporter-1.8.1/bin/node_exporter --help
|
||||
extraFlags = [
|
||||
"--collector.ethtool"
|
||||
"--collector.softirqs"
|
||||
"--collector.tcpstat"
|
||||
"--collector.wifi"
|
||||
];
|
||||
};
|
||||
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
globalConfig.scrape_interval = "30s";
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"localhost:${toString config.services.prometheus.exporters.node.port}"
|
||||
"localhost:8096"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "jellyfin";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"localhost:9594"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue