Browse Source

fix(monitor): mark monitor as down when one check fails, up if no checks

bertyhell/feature/monitor-checks
Bert Verhelst 3 years ago
parent
commit
296ca50d5b
  1. 2
      server/model/monitor.js
  2. 1
      server/validate-monitor-checks.js

2
server/model/monitor.js

@ -273,7 +273,7 @@ class Monitor extends BeanModel {
retries = 0; retries = 0;
} catch (error) { } catch (error) {
bean.status = DOWN;
bean.msg = error.message; bean.msg = error.message;
// If UP come in here, it must be upside down mode // If UP come in here, it must be upside down mode

1
server/validate-monitor-checks.js

@ -101,6 +101,7 @@ function validateMonitorChecks(res, checks, bean) {
throw new Error(`${bean.msg}, encountered unknown monitor_check.type`); throw new Error(`${bean.msg}, encountered unknown monitor_check.type`);
} }
}); });
bean.status = UP;
} }
module.exports = validateMonitorChecks; module.exports = validateMonitorChecks;

Loading…
Cancel
Save