From fa490d0bf1fa64ad601d9d6b12ef9410b4d5966b Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 4 Mar 2022 14:13:44 +0800 Subject: [PATCH] [Alerta] Handle general message --- server/notification-providers/alerta.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/notification-providers/alerta.js b/server/notification-providers/alerta.js index f00d10980..e692b57ba 100644 --- a/server/notification-providers/alerta.js +++ b/server/notification-providers/alerta.js @@ -30,13 +30,14 @@ class Alerta extends NotificationProvider { }; if (heartbeatJSON == null) { - let testdata = Object.assign( { - event: "test", - text: "Testing Successful.", - group: "uptimekuma-test", - resource: "Test", - }, data ); - await axios.post(alertaUrl, testdata, config); + let postData = Object.assign({ + event: "msg", + text: msg, + group: "uptimekuma-msg", + resource: "Message", + }, data); + + await axios.post(alertaUrl, postData, config); } else { let datadup = Object.assign( { correlate: ["service_up", "service_down"],