Forum Discussion

Grayson_149410's avatar
Grayson_149410
Icon for Nimbostratus rankNimbostratus
Mar 23, 2016

Healthcheck - JSON Response

Normally we use just normal http or https port checks to determine if the server is up or not. We are trying to change this and require developers to work on creating health checks into their sites.

The devs want to use JSON response and HTTP 200 response to determine up/down.

Here is what they would like to do.

Go to the following page:

https://subsite.company.com/CurrentVersion/HealthCheck

which redirects to below:

https://subsite.company.com/v1.0/HealthCheck

and returns this in JSON format

{"Uri":"https://subsite.company.com/CurrentVersion/HealthCheck","CurrentVersion":"v1.0"}

What is the best way to do this? The server is listening on port 443. Can I use a normal HTTPS monitor to do this or do I need to use a different method?

6 Replies

  • If you want to follow the redirect for your health check you will have to create an external monitor that leverages curl -L which will follow the redirect.

     

    • Grayson_149410's avatar
      Grayson_149410
      Icon for Nimbostratus rankNimbostratus
      Do you have a good example of a curl external monitor? I'd like to try to figure out myself but need some direction as a lot of this is new to me.
  • If you want to follow the redirect for your health check you will have to create an external monitor that leverages curl -L which will follow the redirect.

     

    • Grayson_149410's avatar
      Grayson_149410
      Icon for Nimbostratus rankNimbostratus
      Do you have a good example of a curl external monitor? I'd like to try to figure out myself but need some direction as a lot of this is new to me.
  • Just bumping this up to see if anyone has any suggestions. I have verified that it actually doesn't do a redirect, all it does is place a JSON string on the webpage. It appears my monitors do not like { } brackets.