summaryrefslogtreecommitdiffstats
path: root/lass/2configs/monitoring/prometheus.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-09-09 19:42:08 +0200
committermakefu <github@syntax-fehler.de>2023-09-09 19:42:08 +0200
commit29d72c898d674d2c18fc0f4a76b5e623de0c3dfe (patch)
treefc4b0695c986a1cda6f1fbbbcbe716e203c54fa3 /lass/2configs/monitoring/prometheus.nix
parente157ffa72856e4378aa23b096b2efff233f3cb3d (diff)
parent083229d0211096daec08673f743ccc45b1d8a0ac (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/2configs/monitoring/prometheus.nix')
-rw-r--r--lass/2configs/monitoring/prometheus.nix110
1 files changed, 0 insertions, 110 deletions
diff --git a/lass/2configs/monitoring/prometheus.nix b/lass/2configs/monitoring/prometheus.nix
deleted file mode 100644
index ba32c62a7..000000000
--- a/lass/2configs/monitoring/prometheus.nix
+++ /dev/null
@@ -1,110 +0,0 @@
-{ config, lib, pkgs, ... }:
-{
- #prometheus
- krebs.iptables = {
- enable = true;
- tables.filter.INPUT.rules = [
- { predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; } # nginx
- # { predicate = "-i retiolum -p tcp --dport 3012"; target = "ACCEPT"; } # grafana
- # { predicate = "-i retiolum -p tcp --dport 9093"; target = "ACCEPT"; } # alertmanager
- # { predicate = "-i retiolum -p tcp --dport 9223"; target = "ACCEPT"; } # alertmanager
- ];
- };
-
- services.nginx = {
- enable = true;
- virtualHosts = {
- "prometheus.lass.r" = {
- locations."/".proxyPass = "http://localhost:9090";
- };
- "alert.lass.r" = {
- locations."/".proxyPass = "http://localhost:9093";
- };
- "grafana.lass.r" = {
- locations."/".proxyPass = "http://localhost:3012";
- };
- };
- };
-
- services.grafana = {
- enable = true;
- addr = "0.0.0.0";
- port = 3012;
- auth.anonymous = {
- enable = true;
- org_role = "Admin";
- };
- };
- services.prometheus = {
- enable = true;
- ruleFiles = [
- (pkgs.writeText "prometheus-rules.yml" (builtins.toJSON {
- groups = [{
- name = "alerting-rules";
- rules = import ./alert-rules.nix { inherit lib; };
- }];
- }))
- ];
- scrapeConfigs = [
- {
- job_name = "telegraf";
- scrape_interval = "60s";
- metrics_path = "/metrics";
- static_configs = [
- {
- targets = [
- "prism.r:9273"
- "dishfire.r:9273"
- "yellow.r:9273"
- ];
- }
- ];
- }
- ];
- alertmanagers = [
- { scheme = "http";
- path_prefix = "/";
- static_configs = [ { targets = [ "localhost:9093" ]; } ];
- }
- ];
- alertmanager = {
- enable = true;
- webExternalUrl = "https://alert.lass.r";
- listenAddress = "[::1]";
- configuration = {
- global = {
- # The smarthost and SMTP sender used for mail notifications.
- smtp_smarthost = "localhost:587";
- smtp_from = "alertmanager@alert.lass.r";
- # smtp_auth_username = "alertmanager@thalheim.io";
- # smtp_auth_password = "$SMTP_PASSWORD";
- };
- route = {
- receiver = "default";
- routes = [
- {
- group_by = [ "host" ];
- group_wait = "30s";
- group_interval = "2m";
- repeat_interval = "2h";
- receiver = "all";
- }
- ];
- };
- receivers = [
- {
- name = "all";
- webhook_configs = [{
- url = "http://127.0.0.1:9223/";
- max_alerts = 5;
- }];
- }
- {
- name = "default";
- }
- ];
- };
- };
- };
-
-}