From dac9b4ac2f17ee37d98722a1159f504c3eed2861 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Sat, 17 Apr 2021 17:30:37 +0200 Subject: [PATCH] do not send alerts when there are no metrics --- check_nodes/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_nodes/main.go b/check_nodes/main.go index 0f7662b..a267823 100644 --- a/check_nodes/main.go +++ b/check_nodes/main.go @@ -284,6 +284,8 @@ func vbat2percent(vbat string) int { func getLastMetrics(deveui string) OneMetric { var res OneMetric + res.BatteryPercent = "999" + url := "http://localhost:8086/api/v2/query?org=wobischorg" data := []byte(fmt.Sprintf(`from(bucket:"wobischbucket") |> range(start:-5d)