mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
added docker health status
This commit is contained in:
parent
9dc02bb8e2
commit
f653aba735
1 changed files with 10 additions and 3 deletions
|
@ -574,10 +574,17 @@ class Monitor extends BeanModel {
|
|||
|
||||
log.debug("monitor", `[${this.name}] Axios Request`);
|
||||
let res = await axios.request(options);
|
||||
if (res.data.State.Running) {
|
||||
|
||||
if (res.data.State.Health && res.data.State.Health.Status !== "healthy"){
|
||||
bean.status = PENDING;
|
||||
bean.msg = res.data.State.Health.Status;
|
||||
log.debug("monitor", `[${this.name}] Monitor is ${res.data.State.Health.Status}`);
|
||||
}
|
||||
else if (res.data.State.Running) {
|
||||
bean.status = UP;
|
||||
bean.msg = res.data.State.Status;
|
||||
} else {
|
||||
bean.msg = res.data.State.Health? res.data.State.Health.Status:res.data.State.Status;
|
||||
}
|
||||
else {
|
||||
throw Error("Container State is " + res.data.State.Status);
|
||||
}
|
||||
} else if (this.type === "mqtt") {
|
||||
|
|
Loading…
Reference in a new issue