mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-01-18 18:38:07 +00:00
Replace monitorJSON.name with monitorJSON.pathName in all notification providers (where applicable)
As noted in #3798, it would be great to have the alarm notification include the full monitor path. This was done for Mattermost in #3801, but not for the other notification providers. This commit replaces all other trivial occurences of monitorJSON.name with monitorJSON.pathName.
This commit is contained in:
parent
be2faf64ce
commit
216f39d556
24 changed files with 45 additions and 45 deletions
|
@ -44,7 +44,7 @@ class Alerta extends NotificationProvider {
|
||||||
correlate: [ "service_up", "service_down" ],
|
correlate: [ "service_up", "service_down" ],
|
||||||
event: monitorJSON["type"],
|
event: monitorJSON["type"],
|
||||||
group: "uptimekuma-" + monitorJSON["type"],
|
group: "uptimekuma-" + monitorJSON["type"],
|
||||||
resource: monitorJSON["name"],
|
resource: monitorJSON["pathName"],
|
||||||
}, data );
|
}, data );
|
||||||
|
|
||||||
if (heartbeatJSON["status"] === DOWN) {
|
if (heartbeatJSON["status"] === DOWN) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ class AliyunSMS extends NotificationProvider {
|
||||||
try {
|
try {
|
||||||
if (heartbeatJSON != null) {
|
if (heartbeatJSON != null) {
|
||||||
let msgBody = JSON.stringify({
|
let msgBody = JSON.stringify({
|
||||||
name: monitorJSON["name"],
|
name: monitorJSON["pathName"],
|
||||||
time: heartbeatJSON["time"],
|
time: heartbeatJSON["time"],
|
||||||
status: this.statusToString(heartbeatJSON["status"]),
|
status: this.statusToString(heartbeatJSON["status"]),
|
||||||
msg: heartbeatJSON["msg"],
|
msg: heartbeatJSON["msg"],
|
||||||
|
|
|
@ -17,8 +17,8 @@ class DingDing extends NotificationProvider {
|
||||||
let params = {
|
let params = {
|
||||||
msgtype: "markdown",
|
msgtype: "markdown",
|
||||||
markdown: {
|
markdown: {
|
||||||
title: `[${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]}`,
|
title: `[${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["pathName"]}`,
|
||||||
text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["pathName"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
||||||
},
|
},
|
||||||
"at": {
|
"at": {
|
||||||
"isAtAll": notification.mentioning === "everyone"
|
"isAtAll": notification.mentioning === "everyone"
|
||||||
|
|
|
@ -38,13 +38,13 @@ class Discord extends NotificationProvider {
|
||||||
let discorddowndata = {
|
let discorddowndata = {
|
||||||
username: discordDisplayName,
|
username: discordDisplayName,
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "❌ Your service " + monitorJSON["name"] + " went down. ❌",
|
title: "❌ Your service " + monitorJSON["pathName"] + " went down. ❌",
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
timestamp: heartbeatJSON["time"],
|
timestamp: heartbeatJSON["time"],
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "Service Name",
|
name: "Service Name",
|
||||||
value: monitorJSON["name"],
|
value: monitorJSON["pathName"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
||||||
|
@ -75,13 +75,13 @@ class Discord extends NotificationProvider {
|
||||||
let discordupdata = {
|
let discordupdata = {
|
||||||
username: discordDisplayName,
|
username: discordDisplayName,
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "✅ Your service " + monitorJSON["name"] + " is up! ✅",
|
title: "✅ Your service " + monitorJSON["pathName"] + " is up! ✅",
|
||||||
color: 65280,
|
color: 65280,
|
||||||
timestamp: heartbeatJSON["time"],
|
timestamp: heartbeatJSON["time"],
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "Service Name",
|
name: "Service Name",
|
||||||
value: monitorJSON["name"],
|
value: monitorJSON["pathName"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Feishu extends NotificationProvider {
|
||||||
header: {
|
header: {
|
||||||
title: {
|
title: {
|
||||||
tag: "plain_text",
|
tag: "plain_text",
|
||||||
content: "UptimeKuma Alert: [Down] " + monitorJSON["name"],
|
content: "UptimeKuma Alert: [Down] " + monitorJSON["pathName"],
|
||||||
},
|
},
|
||||||
template: "red",
|
template: "red",
|
||||||
},
|
},
|
||||||
|
@ -64,7 +64,7 @@ class Feishu extends NotificationProvider {
|
||||||
header: {
|
header: {
|
||||||
title: {
|
title: {
|
||||||
tag: "plain_text",
|
tag: "plain_text",
|
||||||
content: "UptimeKuma Alert: [UP] " + monitorJSON["name"],
|
content: "UptimeKuma Alert: [UP] " + monitorJSON["pathName"],
|
||||||
},
|
},
|
||||||
template: "green",
|
template: "green",
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,8 +22,8 @@ class GoogleChat extends NotificationProvider {
|
||||||
if (monitorJSON && heartbeatJSON) {
|
if (monitorJSON && heartbeatJSON) {
|
||||||
chatHeader["title"] =
|
chatHeader["title"] =
|
||||||
heartbeatJSON["status"] === UP
|
heartbeatJSON["status"] === UP
|
||||||
? `✅ ${monitorJSON["name"]} is back online`
|
? `✅ ${monitorJSON["pathName"]} is back online`
|
||||||
: `🔴 ${monitorJSON["name"]} went down`;
|
: `🔴 ${monitorJSON["pathName"]} went down`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// always show msg
|
// always show msg
|
||||||
|
|
|
@ -26,7 +26,7 @@ class GrafanaOncall extends NotificationProvider {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
} else if (heartbeatJSON["status"] === DOWN) {
|
} else if (heartbeatJSON["status"] === DOWN) {
|
||||||
let grafanadowndata = {
|
let grafanadowndata = {
|
||||||
title: monitorJSON["name"] + " is down",
|
title: monitorJSON["pathName"] + " is down",
|
||||||
message: heartbeatJSON["msg"],
|
message: heartbeatJSON["msg"],
|
||||||
state: "alerting",
|
state: "alerting",
|
||||||
};
|
};
|
||||||
|
@ -34,7 +34,7 @@ class GrafanaOncall extends NotificationProvider {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
} else if (heartbeatJSON["status"] === UP) {
|
||||||
let grafanaupdata = {
|
let grafanaupdata = {
|
||||||
title: monitorJSON["name"] + " is up",
|
title: monitorJSON["pathName"] + " is up",
|
||||||
message: heartbeatJSON["msg"],
|
message: heartbeatJSON["msg"],
|
||||||
state: "ok",
|
state: "ok",
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,7 @@ class HomeAssistant extends NotificationProvider {
|
||||||
title: "Uptime Kuma",
|
title: "Uptime Kuma",
|
||||||
message: msg,
|
message: msg,
|
||||||
...(notificationService !== "persistent_notification" && { data: {
|
...(notificationService !== "persistent_notification" && { data: {
|
||||||
name: monitorJSON?.name,
|
name: monitorJSON?.pathName,
|
||||||
status: heartbeatJSON?.status,
|
status: heartbeatJSON?.status,
|
||||||
channel: "Uptime Kuma",
|
channel: "Uptime Kuma",
|
||||||
icon_url: "https://github.com/louislam/uptime-kuma/blob/master/public/icon.png?raw=true",
|
icon_url: "https://github.com/louislam/uptime-kuma/blob/master/public/icon.png?raw=true",
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Line extends NotificationProvider {
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"text": "UptimeKuma Alert: [🔴 Down]\n" +
|
"text": "UptimeKuma Alert: [🔴 Down]\n" +
|
||||||
"Name: " + monitorJSON["name"] + " \n" +
|
"Name: " + monitorJSON["pathName"] + " \n" +
|
||||||
heartbeatJSON["msg"] +
|
heartbeatJSON["msg"] +
|
||||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class Line extends NotificationProvider {
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"text": "UptimeKuma Alert: [✅ Up]\n" +
|
"text": "UptimeKuma Alert: [✅ Up]\n" +
|
||||||
"Name: " + monitorJSON["name"] + " \n" +
|
"Name: " + monitorJSON["pathName"] + " \n" +
|
||||||
heartbeatJSON["msg"] +
|
heartbeatJSON["msg"] +
|
||||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class LineNotify extends NotificationProvider {
|
||||||
} else if (heartbeatJSON["status"] === DOWN) {
|
} else if (heartbeatJSON["status"] === DOWN) {
|
||||||
let downMessage = {
|
let downMessage = {
|
||||||
"message": "\n[🔴 Down]\n" +
|
"message": "\n[🔴 Down]\n" +
|
||||||
"Name: " + monitorJSON["name"] + " \n" +
|
"Name: " + monitorJSON["pathName"] + " \n" +
|
||||||
heartbeatJSON["msg"] + "\n" +
|
heartbeatJSON["msg"] + "\n" +
|
||||||
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
};
|
};
|
||||||
|
@ -36,7 +36,7 @@ class LineNotify extends NotificationProvider {
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
} else if (heartbeatJSON["status"] === UP) {
|
||||||
let upMessage = {
|
let upMessage = {
|
||||||
"message": "\n[✅ Up]\n" +
|
"message": "\n[✅ Up]\n" +
|
||||||
"Name: " + monitorJSON["name"] + " \n" +
|
"Name: " + monitorJSON["pathName"] + " \n" +
|
||||||
heartbeatJSON["msg"] + "\n" +
|
heartbeatJSON["msg"] + "\n" +
|
||||||
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ class LunaSea extends NotificationProvider {
|
||||||
|
|
||||||
if (heartbeatJSON["status"] === DOWN) {
|
if (heartbeatJSON["status"] === DOWN) {
|
||||||
let downdata = {
|
let downdata = {
|
||||||
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
"title": "UptimeKuma Alert: " + monitorJSON["pathName"],
|
||||||
"body": "[🔴 Down] " +
|
"body": "[🔴 Down] " +
|
||||||
heartbeatJSON["msg"] +
|
heartbeatJSON["msg"] +
|
||||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
|
@ -36,7 +36,7 @@ class LunaSea extends NotificationProvider {
|
||||||
|
|
||||||
if (heartbeatJSON["status"] === UP) {
|
if (heartbeatJSON["status"] === UP) {
|
||||||
let updata = {
|
let updata = {
|
||||||
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
"title": "UptimeKuma Alert: " + monitorJSON["pathName"],
|
||||||
"body": "[✅ Up] " +
|
"body": "[✅ Up] " +
|
||||||
heartbeatJSON["msg"] +
|
heartbeatJSON["msg"] +
|
||||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Mattermost extends NotificationProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mattermostdata = {
|
let mattermostdata = {
|
||||||
username: monitorJSON.name + " " + mattermostUserName,
|
username: monitorJSON.pathName + " " + mattermostUserName,
|
||||||
channel: mattermostChannel,
|
channel: mattermostChannel,
|
||||||
icon_emoji: iconEmoji,
|
icon_emoji: iconEmoji,
|
||||||
icon_url: mattermostIconUrl,
|
icon_url: mattermostIconUrl,
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Ntfy extends NotificationProvider {
|
||||||
if (heartbeatJSON == null) {
|
if (heartbeatJSON == null) {
|
||||||
let ntfyTestData = {
|
let ntfyTestData = {
|
||||||
"topic": notification.ntfytopic,
|
"topic": notification.ntfytopic,
|
||||||
"title": (monitorJSON?.name || notification.ntfytopic) + " [Uptime-Kuma]",
|
"title": (monitorJSON?.pathName || notification.ntfytopic) + " [Uptime-Kuma]",
|
||||||
"message": msg,
|
"message": msg,
|
||||||
"priority": notification.ntfyPriority,
|
"priority": notification.ntfyPriority,
|
||||||
"tags": [ "test_tube" ],
|
"tags": [ "test_tube" ],
|
||||||
|
@ -52,7 +52,7 @@ class Ntfy extends NotificationProvider {
|
||||||
"topic": notification.ntfytopic,
|
"topic": notification.ntfytopic,
|
||||||
"message": heartbeatJSON.msg,
|
"message": heartbeatJSON.msg,
|
||||||
"priority": priority,
|
"priority": priority,
|
||||||
"title": monitorJSON.name + " " + status + " [Uptime-Kuma]",
|
"title": monitorJSON.pathName + " " + status + " [Uptime-Kuma]",
|
||||||
"tags": tags,
|
"tags": tags,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class Ntfy extends NotificationProvider {
|
||||||
data.actions = [
|
data.actions = [
|
||||||
{
|
{
|
||||||
"action": "view",
|
"action": "view",
|
||||||
"label": "Open " + monitorJSON.name,
|
"label": "Open " + monitorJSON.pathName,
|
||||||
"url": monitorJSON.url,
|
"url": monitorJSON.url,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -43,8 +43,8 @@ class Opsgenie extends NotificationProvider {
|
||||||
|
|
||||||
if (heartbeatJSON.status === DOWN) {
|
if (heartbeatJSON.status === DOWN) {
|
||||||
let data = {
|
let data = {
|
||||||
"message": monitorJSON ? textMsg + `: ${monitorJSON.name}` : textMsg,
|
"message": monitorJSON ? textMsg + `: ${monitorJSON.pathName}` : textMsg,
|
||||||
"alias": monitorJSON.name,
|
"alias": monitorJSON.pathName,
|
||||||
"description": msg,
|
"description": msg,
|
||||||
"source": "Uptime Kuma",
|
"source": "Uptime Kuma",
|
||||||
"priority": `P${priority}`
|
"priority": `P${priority}`
|
||||||
|
@ -54,7 +54,7 @@ class Opsgenie extends NotificationProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heartbeatJSON.status === UP) {
|
if (heartbeatJSON.status === UP) {
|
||||||
let opsgenieAlertsCloseUrl = `${opsgenieAlertsUrl}/${encodeURIComponent(monitorJSON.name)}/close?identifierType=alias`;
|
let opsgenieAlertsCloseUrl = `${opsgenieAlertsUrl}/${encodeURIComponent(monitorJSON.pathName)}/close?identifierType=alias`;
|
||||||
let data = {
|
let data = {
|
||||||
"source": "Uptime Kuma",
|
"source": "Uptime Kuma",
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Pushbullet extends NotificationProvider {
|
||||||
} else if (heartbeatJSON["status"] === DOWN) {
|
} else if (heartbeatJSON["status"] === DOWN) {
|
||||||
let downData = {
|
let downData = {
|
||||||
"type": "note",
|
"type": "note",
|
||||||
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
"title": "UptimeKuma Alert: " + monitorJSON["pathName"],
|
||||||
"body": "[🔴 Down] " +
|
"body": "[🔴 Down] " +
|
||||||
heartbeatJSON["msg"] +
|
heartbeatJSON["msg"] +
|
||||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
||||||
|
@ -39,7 +39,7 @@ class Pushbullet extends NotificationProvider {
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
} else if (heartbeatJSON["status"] === UP) {
|
||||||
let upData = {
|
let upData = {
|
||||||
"type": "note",
|
"type": "note",
|
||||||
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
"title": "UptimeKuma Alert: " + monitorJSON["pathName"],
|
||||||
"body": "[✅ Up] " +
|
"body": "[✅ Up] " +
|
||||||
heartbeatJSON["msg"] +
|
heartbeatJSON["msg"] +
|
||||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
||||||
|
|
|
@ -17,9 +17,9 @@ class PushDeer extends NotificationProvider {
|
||||||
|
|
||||||
let title;
|
let title;
|
||||||
if (valid && heartbeatJSON.status === UP) {
|
if (valid && heartbeatJSON.status === UP) {
|
||||||
title = "## Uptime Kuma: " + monitorJSON.name + " up";
|
title = "## Uptime Kuma: " + monitorJSON.pathName + " up";
|
||||||
} else if (valid && heartbeatJSON.status === DOWN) {
|
} else if (valid && heartbeatJSON.status === DOWN) {
|
||||||
title = "## Uptime Kuma: " + monitorJSON.name + " down";
|
title = "## Uptime Kuma: " + monitorJSON.pathName + " down";
|
||||||
} else {
|
} else {
|
||||||
title = "## Uptime Kuma Message";
|
title = "## Uptime Kuma Message";
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,10 +39,10 @@ class ServerChan extends NotificationProvider {
|
||||||
checkStatus(heartbeatJSON, monitorJSON) {
|
checkStatus(heartbeatJSON, monitorJSON) {
|
||||||
let title = "UptimeKuma Message";
|
let title = "UptimeKuma Message";
|
||||||
if (heartbeatJSON != null && heartbeatJSON["status"] === UP) {
|
if (heartbeatJSON != null && heartbeatJSON["status"] === UP) {
|
||||||
title = "UptimeKuma Monitor Up " + monitorJSON["name"];
|
title = "UptimeKuma Monitor Up " + monitorJSON["pathName"];
|
||||||
}
|
}
|
||||||
if (heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
|
if (heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
|
||||||
title = "UptimeKuma Monitor Down " + monitorJSON["name"];
|
title = "UptimeKuma Monitor Down " + monitorJSON["pathName"];
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,10 +39,10 @@ class SevenIO extends NotificationProvider {
|
||||||
|
|
||||||
// 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) {
|
||||||
data.text = `Your service ${monitorJSON["name"]} ${address}went down at ${heartbeatJSON["localDateTime"]} ` +
|
data.text = `Your service ${monitorJSON["pathName"]} ${address}went down at ${heartbeatJSON["localDateTime"]} ` +
|
||||||
`(${heartbeatJSON["timezone"]}). Error: ${heartbeatJSON["msg"]}`;
|
`(${heartbeatJSON["timezone"]}). Error: ${heartbeatJSON["msg"]}`;
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
} else if (heartbeatJSON["status"] === UP) {
|
||||||
data.text = `Your service ${monitorJSON["name"]} ${address}went back up at ${heartbeatJSON["localDateTime"]} ` +
|
data.text = `Your service ${monitorJSON["pathName"]} ${address}went back up at ${heartbeatJSON["localDateTime"]} ` +
|
||||||
`(${heartbeatJSON["timezone"]}).`;
|
`(${heartbeatJSON["timezone"]}).`;
|
||||||
}
|
}
|
||||||
await axios.post("sms", data, config);
|
await axios.post("sms", data, config);
|
||||||
|
|
|
@ -92,7 +92,7 @@ class SMTP extends NotificationProvider {
|
||||||
let monitorHostnameOrURL = "testing.hostname";
|
let monitorHostnameOrURL = "testing.hostname";
|
||||||
|
|
||||||
if (monitorJSON !== null) {
|
if (monitorJSON !== null) {
|
||||||
monitorName = monitorJSON["name"];
|
monitorName = monitorJSON["pathName"];
|
||||||
monitorHostnameOrURL = this.extractAddress(monitorJSON);
|
monitorHostnameOrURL = this.extractAddress(monitorJSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,10 @@ class Squadcast extends NotificationProvider {
|
||||||
data.event_id = heartbeatJSON["monitorID"];
|
data.event_id = heartbeatJSON["monitorID"];
|
||||||
|
|
||||||
if (heartbeatJSON["status"] === DOWN) {
|
if (heartbeatJSON["status"] === DOWN) {
|
||||||
data.message = `${monitorJSON["name"]} is DOWN`;
|
data.message = `${monitorJSON["pathName"]} is DOWN`;
|
||||||
data.status = "trigger";
|
data.status = "trigger";
|
||||||
} else {
|
} else {
|
||||||
data.message = `${monitorJSON["name"]} is UP`;
|
data.message = `${monitorJSON["pathName"]} is UP`;
|
||||||
data.status = "resolve";
|
data.status = "resolve";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ class Stackfield extends NotificationProvider {
|
||||||
|
|
||||||
let textMsg = "+Uptime Kuma Alert+";
|
let textMsg = "+Uptime Kuma Alert+";
|
||||||
|
|
||||||
if (monitorJSON && monitorJSON.name) {
|
if (monitorJSON && monitorJSON.pathName) {
|
||||||
textMsg += `\n*${monitorJSON.name}*`;
|
textMsg += `\n*${monitorJSON.pathName}*`;
|
||||||
}
|
}
|
||||||
|
|
||||||
textMsg += `\n${msg}`;
|
textMsg += `\n${msg}`;
|
||||||
|
|
|
@ -224,7 +224,7 @@ class Teams extends NotificationProvider {
|
||||||
|
|
||||||
const payload = this._notificationPayloadFactory({
|
const payload = this._notificationPayloadFactory({
|
||||||
heartbeatJSON: heartbeatJSON,
|
heartbeatJSON: heartbeatJSON,
|
||||||
monitorName: monitorJSON.name,
|
monitorName: monitorJSON.pathName,
|
||||||
monitorUrl: this.extractAddress(monitorJSON),
|
monitorUrl: this.extractAddress(monitorJSON),
|
||||||
dashboardUrl: dashboardUrl,
|
dashboardUrl: dashboardUrl,
|
||||||
});
|
});
|
||||||
|
|
|
@ -39,10 +39,10 @@ class WPush extends NotificationProvider {
|
||||||
checkStatus(heartbeatJSON, monitorJSON) {
|
checkStatus(heartbeatJSON, monitorJSON) {
|
||||||
let title = "UptimeKuma Message";
|
let title = "UptimeKuma Message";
|
||||||
if (heartbeatJSON != null && heartbeatJSON["status"] === UP) {
|
if (heartbeatJSON != null && heartbeatJSON["status"] === UP) {
|
||||||
title = "UptimeKuma Monitor Up " + monitorJSON["name"];
|
title = "UptimeKuma Monitor Up " + monitorJSON["pathName"];
|
||||||
}
|
}
|
||||||
if (heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
|
if (heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
|
||||||
title = "UptimeKuma Monitor Down " + monitorJSON["name"];
|
title = "UptimeKuma Monitor Down " + monitorJSON["pathName"];
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ class ZohoCliq extends NotificationProvider {
|
||||||
|
|
||||||
const payload = this._notificationPayloadFactory({
|
const payload = this._notificationPayloadFactory({
|
||||||
monitorMessage: heartbeatJSON.msg,
|
monitorMessage: heartbeatJSON.msg,
|
||||||
monitorName: monitorJSON.name,
|
monitorName: monitorJSON.pathName,
|
||||||
monitorUrl: this.extractAddress(monitorJSON),
|
monitorUrl: this.extractAddress(monitorJSON),
|
||||||
status: heartbeatJSON.status
|
status: heartbeatJSON.status
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue