-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2be5044
commit cc3d9ac
Showing
5 changed files
with
81 additions
and
31 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
{ | ||
# Enable netdata, which is a lightweight alternative to Grafana. | ||
# https://nixos.wiki/wiki/Netdata | ||
# https://dataswamp.org/~solene/2022-09-16-netdata-cloud-nixos.html | ||
services.netdata = { | ||
enable = true; | ||
config = { | ||
global = { | ||
# Disable storage of metrics on disk. | ||
"memory mode" = "none"; | ||
}; | ||
web = { | ||
# Disable the web UI. | ||
"mode" = "none"; | ||
"accept a streaming request every seconds" = 0; | ||
}; | ||
}; | ||
configDir = { | ||
"stream.conf" = pkgs.writeText "stream.conf" '' | ||
[stream] | ||
enabled = yes | ||
api key = ${builtins.readFile <acm-aws/secrets/netdata-key>} | ||
destination = cs306:19999 | ||
''; | ||
}; | ||
}; | ||
|
||
# Gather system metrics using Telegraf into cirno's VictoriaMetrics. | ||
services.telegraf = { | ||
enable = true; | ||
extraConfig = { | ||
inputs = { | ||
net = {}; | ||
mem = {}; | ||
disk = {}; | ||
swap = {}; | ||
system = {}; | ||
diskio = {}; | ||
processes = {}; | ||
prometheus = { | ||
urls = [ | ||
"http://localhost:2019/metrics" # Caddy | ||
]; | ||
}; | ||
systemd_units = {}; | ||
internet_speed = { | ||
interval = "2h"; | ||
}; | ||
}; | ||
outputs = { | ||
influxdb = { | ||
database = "telegraf"; | ||
urls = [ "http://cs306:8428" ]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters