|
@@ -121,7 +121,7 @@ export class HttpCheckController {
|
|
|
if (lastErrors.length > conf.notifyThreshold) {
|
|
if (lastErrors.length > conf.notifyThreshold) {
|
|
|
Logger.debug(`[DEBUG] Sending [RECOVERY] FCM Notification for`, conf.title);
|
|
Logger.debug(`[DEBUG] Sending [RECOVERY] FCM Notification for`, conf.title);
|
|
|
await FCMController.instance.sendNotificationToTopic(defaults.fcmTopics.services, {
|
|
await FCMController.instance.sendNotificationToTopic(defaults.fcmTopics.services, {
|
|
|
- title: `[RECOVERY] ${conf.title} since ${moment(now).format('HH:mm')}`,
|
|
|
|
|
|
|
+ title: `[RECOVERY] ${moment(now).format('HH:mm')} ${conf.title}: [OK]`,
|
|
|
body: `HTTP Check '${conf.title}' has recovered to [OK].`
|
|
body: `HTTP Check '${conf.title}' has recovered to [OK].`
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -168,7 +168,7 @@ export class HttpCheckController {
|
|
|
const lastCheck = lastErrors[0];
|
|
const lastCheck = lastErrors[0];
|
|
|
const lastError = lastCheck.data[0];
|
|
const lastError = lastCheck.data[0];
|
|
|
await FCMController.instance.sendNotificationToTopic(defaults.fcmTopics.services, {
|
|
await FCMController.instance.sendNotificationToTopic(defaults.fcmTopics.services, {
|
|
|
- title: `[CRIT] ${conf.title} failed at ${moment(lastCheck.time).format('HH:mm')}`,
|
|
|
|
|
|
|
+ title: `[CRIT] ${moment(lastCheck.time).format('HH:mm')} ${conf.title} failed`,
|
|
|
body:
|
|
body:
|
|
|
`HTTP Check '${conf.title}' has failed over ${conf.notifyThreshold} times in a row.\n` +
|
|
`HTTP Check '${conf.title}' has failed over ${conf.notifyThreshold} times in a row.\n` +
|
|
|
`Last error status was: (${lastError.status}) ${lastError.message}`
|
|
`Last error status was: (${lastError.status}) ${lastError.message}`
|