even more backups of things

This commit is contained in:
Jay Looney 2025-10-28 16:11:45 -05:00
parent b8d125d448
commit 630f9b0074
46 changed files with 1166 additions and 197 deletions

View file

@ -0,0 +1,14 @@
# hosts/lithium/services/monitoring
This is a Grafana/Prometheus Monitoring Stack.
Why? Basically for the sake of it.
## Diagram
```mermaid
````
## References
- https://gist.github.com/rickhull/895b0cb38fdd537c1078a858cf15d63e
- https://xeiaso.net/blog/prometheus-grafana-loki-nixos-2020-11-20/

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{ inputs, config, pkgs, ... }:
let
svcDomain = "grafana.${config.networking.domain}";
homelabDomain = inputs.nixos-secrets.homelabDomain;
#svcDomain = "grafana.${config.networking.domain}";
svcDomain = "grafana.${homelabDomain}";
svcPort = config.services.grafana.settings.server.http_port;
in
{

View file

@ -0,0 +1,4 @@
auth_enabled: false
server:
http_listen_port: 3100

View file

@ -0,0 +1,15 @@
{ ... }:
{
services.loki = {
enable = true;
#configFile = "./loki-local-config.yaml";
# Nix Object representing the data that might otherwise be in a YAML config
# https://github.com/grafana/loki/blob/main/cmd/loki/loki-local-config.yaml
configuration = {
auth_enabled = false;
server = {
};
};
};
}

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
#let
let
#svcDomain = "status.${config.networking.domain}";
#svcPort = config.services.prometheus.exporters.node.port;
#in
svcPort = config.services.prometheus.exporters.node.port;
in
{
#services.caddy.virtualHosts."${svcDomain}".extraConfig = ''
#reverse_proxy :${svcPort}
@ -10,20 +10,27 @@
services.prometheus = {
enable = true;
port = 9090;
#globalConfig.scrape_interval = "10s"; # "1m"
#scrapeConfigs = [
#{
#job_name = "node";
#static_configs = [{
# targets = [ "localhost:${toString svcPort}" ];
#}];
#}
#];
exporters = {
# Export data about this host
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9091;
};
};
# Read data from the export
scrapeConfigs = [
{
job_name = "node-lithium";
static_configs = [{
targets = [ "localhost:${toString svcPort}" ];
}];
}
];
};
#services.prometheus.exporters.node = {
#enable = true;
#port = 9000;
#enabledCollectors = [ "systemd" ];
#};
}