|
|
@ -33,26 +33,6 @@ class Discord extends NotificationProvider {
|
|
|
|
return okMsg;
|
|
|
|
return okMsg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let address;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (monitorJSON["type"]) {
|
|
|
|
|
|
|
|
case "ping":
|
|
|
|
|
|
|
|
address = monitorJSON["hostname"];
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "port":
|
|
|
|
|
|
|
|
case "dns":
|
|
|
|
|
|
|
|
case "gamedig":
|
|
|
|
|
|
|
|
case "steam":
|
|
|
|
|
|
|
|
address = monitorJSON["hostname"];
|
|
|
|
|
|
|
|
if (monitorJSON["port"]) {
|
|
|
|
|
|
|
|
address += ":" + monitorJSON["port"];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
address = monitorJSON["url"];
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If heartbeatJSON is not null, we go into the normal alerting loop.
|
|
|
|
// If heartbeatJSON is not null, we go into the normal alerting loop.
|
|
|
|
if (heartbeatJSON["status"] === DOWN) {
|
|
|
|
if (heartbeatJSON["status"] === DOWN) {
|
|
|
|
let discorddowndata = {
|
|
|
|
let discorddowndata = {
|
|
|
@ -105,7 +85,7 @@ class Discord extends NotificationProvider {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
|
|
|
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
|
|
|
value: monitorJSON["type"] === "push" ? "Heartbeat" : address,
|
|
|
|
value: this.extractAdress(monitorJSON),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: `Time (${heartbeatJSON["timezone"]})`,
|
|
|
|
name: `Time (${heartbeatJSON["timezone"]})`,
|
|
|
|