From 90f24975482068131258d672522047fc3c8ce7d4 Mon Sep 17 00:00:00 2001 From: Alvin Pergens Date: Fri, 28 Jan 2022 15:14:34 +0100 Subject: [PATCH] change data for Alerta --- server/notification-providers/alerta.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/alerta.js b/server/notification-providers/alerta.js index d3b1a23c..3ee331ac 100644 --- a/server/notification-providers/alerta.js +++ b/server/notification-providers/alerta.js @@ -40,19 +40,18 @@ class Alerta extends NotificationProvider { } else { let datadup = Object.assign( { correlate: ["service_up", "service_down"], + event: monitorJSON["type"], group: "uptimekuma-" + monitorJSON["type"], resource: monitorJSON["name"], }, data ); if (heartbeatJSON["status"] == DOWN) { datadup.severity = notification.alertaAlertState; // critical - datadup.event = "service_state"; - datadup.text = "Service is down."; + datadup.text = "Service " + monitorJSON["type"] + " is down."; await axios.post(alertaUrl, datadup, config); } else if (heartbeatJSON["status"] == UP) { datadup.severity = notification.alertaRecoverState; // cleaner - datadup.event = "service_state"; - datadup.text = "Service is up."; + datadup.text = "Service " + monitorJSON["type"] + " is up."; await axios.post(alertaUrl, datadup, config); } }