From 403b54e30aa477465a57ddf98995d0f2e234a042 Mon Sep 17 00:00:00 2001 From: LapinPancake Date: Fri, 5 Jun 2026 22:23:38 +0200 Subject: [PATCH] =?UTF-8?q?on=20avait=20oubli=C3=A9=20qq=20eaton=20par=20c?= =?UTF-8?q?i=20par=20l=C3=A0=20(on=20renome=20tout=20en=20ups)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/vm/victoriametrics/rules/default.nix | 2 +- .../rules/{eaton.nix => ups.nix} | 4 ++-- hosts/vm/victoriametrics/scrape.nix | 18 +++++++++--------- hosts/vm/victoriametrics/snmp.nix | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) rename hosts/vm/victoriametrics/rules/{eaton.nix => ups.nix} (71%) diff --git a/hosts/vm/victoriametrics/rules/default.nix b/hosts/vm/victoriametrics/rules/default.nix index a3dee8d..184439c 100644 --- a/hosts/vm/victoriametrics/rules/default.nix +++ b/hosts/vm/victoriametrics/rules/default.nix @@ -3,11 +3,11 @@ { bird = ./bird.nix; ceph = ./ceph.nix; - eaton = ./eaton.nix; ilo = ./ilo.nix; jitsi = ./jitsi.nix; node = ./node.nix; postgresql = ./postgresql.nix; switch = ./switch.nix; unbound = ./unbound.nix; + ups = ./ups.nix; } diff --git a/hosts/vm/victoriametrics/rules/eaton.nix b/hosts/vm/victoriametrics/rules/ups.nix similarity index 71% rename from hosts/vm/victoriametrics/rules/eaton.nix rename to hosts/vm/victoriametrics/rules/ups.nix index f7b4743..e609a1d 100644 --- a/hosts/vm/victoriametrics/rules/eaton.nix +++ b/hosts/vm/victoriametrics/rules/ups.nix @@ -1,7 +1,7 @@ { critical, warning, ... }: { - alerts.EatonBatteryFailure = { + alerts.UpsBatteryFailure = { # s'appelait eatonBatteryFailure avant expr = '' xupsBatteryFailure{xupsBatteryFailure="yes"} == 1 ''; @@ -9,7 +9,7 @@ labels = critical; }; - alerts.EatonBatteryLow = { + alerts.UpsBatteryLow = { # idem expr = '' xupsBatTimeRemaining < 1800 ''; diff --git a/hosts/vm/victoriametrics/scrape.nix b/hosts/vm/victoriametrics/scrape.nix index 0ac1dc7..454f3c5 100644 --- a/hosts/vm/victoriametrics/scrape.nix +++ b/hosts/vm/victoriametrics/scrape.nix @@ -17,15 +17,6 @@ targets = import ./targets/ceph.nix {}; }; - eaton = { - path = "/snmp"; - params.module = [ "eaton" "uptime" ]; - params.auth = [ "eaton" ]; - replacementAddress = "127.0.0.1:9116"; - replacementTarget = "$1"; - targets = import ./targets/eaton.nix {}; - }; - ilo = { path = "/snmp"; params = { @@ -108,6 +99,15 @@ targets = import ./targets/unbound.nix {}; }; + ups = { + path = "/snmp"; + params.module = [ "ups" "uptime" ]; + params.auth = [ "ups" ]; + replacementAddress = "127.0.0.1:9116"; + replacementTarget = "$1"; + targets = import ./targets/ups.nix {}; + }; + # victoria-metrics = { # pour le jour où on aura deux victoriametrics pour se surveiller l'un l'autre # replacementAddress = "$1:8428"; # targets = [ diff --git a/hosts/vm/victoriametrics/snmp.nix b/hosts/vm/victoriametrics/snmp.nix index 924eb48..9625760 100644 --- a/hosts/vm/victoriametrics/snmp.nix +++ b/hosts/vm/victoriametrics/snmp.nix @@ -11,23 +11,23 @@ priv_protocol = "AES"; priv_password = "\${ILO_PRIV}"; }; - eaton = { + ups = { version = 1; community = "prometheus"; }; ## Tenté, échoue sur 10.201.3.1 (celui dans le local serveurs de EDC). :( - #eaton = { + #ups = { # version = 3; # username = "prometheus"; # security_level = "authPriv"; # auth_protocol = "SHA"; - # password = "\${EATON_AUTH}"; + # password = "\${ups_AUTH}"; # priv_protocol = "AES"; - # priv_password = "\${EATON_PRIV}"; + # priv_password = "\${ups_PRIV}"; #}; }; - modules.eaton = { + modules.ups = { walk = [ "xupsInput" "xupsOutput"