From 171f41bd417806ce6d4eae3e6563beb77ffa84c2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 7 Jan 2022 01:42:06 +0100 Subject: vidhar: ... --- hosts/vidhar/prometheus/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index e305ff84..f4e8d7e5 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix @@ -210,6 +210,22 @@ in { } ]; } + { name = "apcupsd-transfers"; + rules = [ + { record = "apcupsd_last_transfer_on_battery_counter_seconds"; + expr = "timestamp(apcupsd_last_transfer_on_battery_time_seconds) - (apcupsd_last_transfer_on_battery_time_seconds > 0)"; + } + { record = "apcupsd_last_transfer_on_battery_counter_seconds:resets_per_hour"; + expr = "resets(apcupsd_last_transfer_on_battery_counter_seconds[1h])"; + } + { record = "apcupsd_last_transfer_on_battery_counter_seconds:resets_per_day"; + expr = "resets(apcupsd_last_transfer_on_battery_counter_seconds[1d])"; + } + { record = "apcupsd_last_transfer_on_battery_counter_seconds:resets_per_wook"; + expr = "resets(apcupsd_last_transfer_on_battery_counter_seconds[1w])"; + } + ]; + } ]; }) ]; -- cgit v1.2.3