change data for Alerta

pull/1228/head
Alvin Pergens 3 years ago
parent cefe43800f
commit 90f2497548

@ -40,19 +40,18 @@ class Alerta extends NotificationProvider {
} else { } else {
let datadup = Object.assign( { let datadup = Object.assign( {
correlate: ["service_up", "service_down"], correlate: ["service_up", "service_down"],
event: monitorJSON["type"],
group: "uptimekuma-" + monitorJSON["type"], group: "uptimekuma-" + monitorJSON["type"],
resource: monitorJSON["name"], resource: monitorJSON["name"],
}, data ); }, data );
if (heartbeatJSON["status"] == DOWN) { if (heartbeatJSON["status"] == DOWN) {
datadup.severity = notification.alertaAlertState; // critical datadup.severity = notification.alertaAlertState; // critical
datadup.event = "service_state"; datadup.text = "Service " + monitorJSON["type"] + " is down.";
datadup.text = "Service is down.";
await axios.post(alertaUrl, datadup, config); await axios.post(alertaUrl, datadup, config);
} else if (heartbeatJSON["status"] == UP) { } else if (heartbeatJSON["status"] == UP) {
datadup.severity = notification.alertaRecoverState; // cleaner datadup.severity = notification.alertaRecoverState; // cleaner
datadup.event = "service_state"; datadup.text = "Service " + monitorJSON["type"] + " is up.";
datadup.text = "Service is up.";
await axios.post(alertaUrl, datadup, config); await axios.post(alertaUrl, datadup, config);
} }
} }

Loading…
Cancel
Save