mirror of
				https://github.com/louislam/uptime-kuma.git
				synced 2025-11-01 03:49:24 +08:00 
			
		
		
		
	added docker health status
This commit is contained in:
		| @@ -574,10 +574,17 @@ class Monitor extends BeanModel { | |||||||
|  |  | ||||||
|                     log.debug("monitor", `[${this.name}] Axios Request`); |                     log.debug("monitor", `[${this.name}] Axios Request`); | ||||||
|                     let res = await axios.request(options); |                     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.status = UP; | ||||||
|                         bean.msg = res.data.State.Status; |                         bean.msg = res.data.State.Health? res.data.State.Health.Status:res.data.State.Status; | ||||||
|                     } else { |                     } | ||||||
|  |                     else { | ||||||
|                         throw Error("Container State is " + res.data.State.Status); |                         throw Error("Container State is " + res.data.State.Status); | ||||||
|                     } |                     } | ||||||
|                 } else if (this.type === "mqtt") { |                 } else if (this.type === "mqtt") { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user