When we check the EMS health status, the EMS server is sending it's status in HTTP headers.
If we use:
user@HAL9000 ~ curl http://localhost:7001/isReady
user@HAL9000
We don't see any reply data
We should use:
user@HAL9000 ~ $ curl -I http://localhost:7001/isReady
HTTP/1.1 200 OK
Date: Fri, 21 Feb 2020 19:30:08 GMT
For standby server:
user@HAL9000 ~ $ curl -I http://localhost:7002/isReady
HTTP/1.1 400 Bad Request
Date: Fri, 21 Feb 2020 19:31:31 GMT
user@HAL9000 ~ $
Is standby server alive?
user@HAL9000 ~ $ curl -I http://localhost:7002/isLive
HTTP/1.1 200 OK
Date: Fri, 21 Feb 2020 19:32:10 GMT
user@HAL9000 ~ $
In case if we use wrong URL
user@HAL9000 ~ $ curl -I http://localhost:7002/wrongString
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Fri, 21 Feb 2020 19:32:38 GMT
Content-Length: 19
user@HAL9000 ~ $
Also you can use
user@HAL9000 ~ $ curl -w "%{http_code}\n" http://localhost:7002/isLive
200
user@HAL9000 ~ $ curl -w "%{http_code}\n" http://localhost:7002/isReady
400
user@HAL9000 ~ $