From d9a60f39a655d16f09bfebbc50fad65e44393a50 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Fri, 31 May 2024 22:33:39 +0200 Subject: [PATCH] falkenstein: remove postfix exporter --- .../modules/monitoring/default.nix | 4 --- .../falkenstein/modules/monitoring/dmarc.nix | 10 ++++++++ hosts/nuc/modules/monitoring/default.nix | 9 +++---- overlays/default.nix | 12 --------- ...001-cleanup-also-catch-milter-reject.patch | 25 ------------------- 5 files changed, 13 insertions(+), 47 deletions(-) create mode 100644 hosts/falkenstein/modules/monitoring/dmarc.nix delete mode 100644 overlays/prometheus-postfix-exporter/0001-cleanup-also-catch-milter-reject.patch diff --git a/hosts/falkenstein/modules/monitoring/default.nix b/hosts/falkenstein/modules/monitoring/default.nix index 4f18bfe..4b389fe 100644 --- a/hosts/falkenstein/modules/monitoring/default.nix +++ b/hosts/falkenstein/modules/monitoring/default.nix @@ -10,9 +10,6 @@ enable = true; enabledCollectors = [ "systemd" ]; }; - postfix = { - enable = true; - }; }; }; services.geoipupdate = { @@ -115,6 +112,5 @@ }; networking.firewall.allowedTCPPorts = [ config.services.prometheus.exporters.node.port - config.services.prometheus.exporters.postfix.port ]; } diff --git a/hosts/falkenstein/modules/monitoring/dmarc.nix b/hosts/falkenstein/modules/monitoring/dmarc.nix new file mode 100644 index 0000000..8946c56 --- /dev/null +++ b/hosts/falkenstein/modules/monitoring/dmarc.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + users.users.dmarc = { + description = "DMARC Report recipient"; + isNormalUser = true; + }; + # services.parsedmarc = { + # enable = true; + # }; +} diff --git a/hosts/nuc/modules/monitoring/default.nix b/hosts/nuc/modules/monitoring/default.nix index ba3aed7..20e3638 100644 --- a/hosts/nuc/modules/monitoring/default.nix +++ b/hosts/nuc/modules/monitoring/default.nix @@ -3,6 +3,9 @@ let domain = "monitoring.${config.networking.domain}"; in { + imports = [ + ./dmarc.nix + ]; age.secrets."grafana/oidc_secret" = { file = ../../../../secrets/nuc/grafana/oidc.age; owner = "grafana"; @@ -104,12 +107,6 @@ in }]; scrape_interval = "15s"; } - { - job_name = "postfix"; - static_configs = [{ - targets = [ "falkenstein.vpn.rfive.de:${toString config.services.prometheus.exporters.postfix.port}" ]; - }]; - } { job_name = "synapse"; static_configs = [{ diff --git a/overlays/default.nix b/overlays/default.nix index 7e4ccb5..3e9738a 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -112,16 +112,4 @@ in pythonPath = python.pkgs.makePythonPath propagatedBuildInputs; }; }); - # (hopefully) fix systemd journal reading - prometheus-postfix-exporter = prev.prometheus-postfix-exporter.overrideAttrs (_old: { - patches = [ - ./prometheus-postfix-exporter/0001-cleanup-also-catch-milter-reject.patch - ]; - src = fetchFromGitHub { - owner = "adangel"; - repo = "postfix_exporter"; - rev = "414ac12ee63415eede46cb3084d755a6da6fba23"; - hash = "sha256-m1kVaO3N7XC1vtnxXX9kMiEFPmZuoopRUYgA7gQzP8w="; - }; - }); } diff --git a/overlays/prometheus-postfix-exporter/0001-cleanup-also-catch-milter-reject.patch b/overlays/prometheus-postfix-exporter/0001-cleanup-also-catch-milter-reject.patch deleted file mode 100644 index 2b60316..0000000 --- a/overlays/prometheus-postfix-exporter/0001-cleanup-also-catch-milter-reject.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f4c5dd5628c873981b2d6d6b8f3bbf036b9fd724 Mon Sep 17 00:00:00 2001 -From: Rouven Seifert -Date: Thu, 2 May 2024 11:20:27 +0200 -Subject: [PATCH] cleanup: also catch milter-reject - ---- - postfix_exporter.go | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/postfix_exporter.go b/postfix_exporter.go -index f20d99c..676d767 100644 ---- a/postfix_exporter.go -+++ b/postfix_exporter.go -@@ -335,6 +335,8 @@ func (e *PostfixExporter) CollectFromLogLine(line string) { - e.cleanupProcesses.Inc() - } else if strings.Contains(remainder, ": reject: ") { - e.cleanupRejects.Inc() -+ } else if strings.Contains(remainder, ": milter-reject: ") { -+ e.cleanupRejects.Inc() - } else { - e.addToUnsupportedLine(line, subprocess, level) - } --- -2.44.0 -