mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-26 06:04:13 -08:00
change data for Alerta
This commit is contained in:
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…
Reference in a new issue