diff --git a/server/model/monitor.js b/server/model/monitor.js index 0e8c9d29d..f95b906ea 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1083,9 +1083,10 @@ class Monitor extends BeanModel { if (this.downRetryInterval > 0) { beatInterval = this.downRetryInterval; } + const intervalNote = this.downRetryInterval > 0 ? " (recovery)" : ""; log.warn( "monitor", - `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}` + `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds${intervalNote} | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}` ); } @@ -1710,11 +1711,14 @@ class Monitor extends BeanModel { throw new Error(`Retry interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`); } - if (this.downRetryInterval > MAX_INTERVAL_SECOND) { - throw new Error(`Down retry interval cannot be more than ${MAX_INTERVAL_SECOND} seconds`); - } - if (this.downRetryInterval < MIN_INTERVAL_SECOND) { - throw new Error(`Down retry interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`); + const downRetryInterval = Number(this.downRetryInterval); + if (downRetryInterval !== 0) { + if (downRetryInterval > MAX_INTERVAL_SECOND) { + throw new Error(`Down retry interval cannot be more than ${MAX_INTERVAL_SECOND} seconds`); + } + if (downRetryInterval < MIN_INTERVAL_SECOND) { + throw new Error(`Down retry interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`); + } } if (this.response_max_length !== undefined) { diff --git a/src/lang/en.json b/src/lang/en.json index f4f075786..97de6e1fe 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -85,6 +85,8 @@ "checkEverySecond": "Check every {0} seconds", "retryCheckEverySecond": "Retry every {0} seconds", "downCheckEverySecond": "Check every {0} seconds while down", + "downRetryIntervalDisabled": "Use heartbeat interval when down", + "downRetryIntervalDescription": "Set to 0 to use the heartbeat interval while the monitor is down.", "resendEveryXTimes": "Resend every {0} times", "resendDisabled": "Resend disabled", "retriesDescription": "Maximum retries before the service is marked as down and a notification is sent", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index fd0b43468..530616d2b 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -1188,7 +1188,10 @@