mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
Monitoring
This commit is contained in:
parent
d32283137a
commit
ab8885a907
5 changed files with 52 additions and 0 deletions
12
nixos/roles/monitoring-server/grafana.nix
Normal file
12
nixos/roles/monitoring-server/grafana.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
domain = "mon.kittywit.ch";
|
||||||
|
port = 2342;
|
||||||
|
addr = "127.0.0.1";
|
||||||
|
};
|
||||||
|
}
|
||||||
8
nixos/roles/monitoring-server/nginx.nix
Normal file
8
nixos/roles/monitoring-server/nginx.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{config, ...}: {
|
||||||
|
services.nginx.virtualHosts.${config.services.grafana.domain} = {
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
23
nixos/roles/monitoring-server/prometheus.nix
Normal file
23
nixos/roles/monitoring-server/prometheus.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{config, ...}: {
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = ["systemd"];
|
||||||
|
port = 9002;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "${config.networking.hostName}";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -15,6 +15,7 @@ _: let
|
||||||
postgres-server
|
postgres-server
|
||||||
matrix-homeserver
|
matrix-homeserver
|
||||||
vaultwarden-server
|
vaultwarden-server
|
||||||
|
monitoring-server
|
||||||
irc-client
|
irc-client
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
8
tf/kw-mon.tf
Normal file
8
tf/kw-mon.tf
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
resource "cloudflare_record" "mon" {
|
||||||
|
name = "mon"
|
||||||
|
proxied = false
|
||||||
|
ttl = 3600
|
||||||
|
type = "CNAME"
|
||||||
|
value = "yukari.gensokyo.zone"
|
||||||
|
zone_id = local.zone_ids.kittywitch
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue