Forum Discussion
Curl usage
A simple curl command to check, whether your HTTP service works as you want would be
curl -vk https://<IP of your server>[:<Port of your Service>]<URI of your Service>A full example could be
curl -vk https://192.168.10.15/path/to/my/appThis would result in an HTTP request
GET /path/to/my/app HTTP/1.1 Host: 192.168.10.15 Connection: keep-alive ...If your server uses name-based Virtual Hosts, you have to adjust the Host-header field, to get the correct response:
curl -vk https//192.168.10.15/path/to/my/app -H "Host: myapp.example.com"You can set more custom headers with `-H`, if necessary.
curl can only be used within the advanced shell (=Bash). A good practice to check for the health status of your app depends on you. A simple HTTP monitor, which checks the response code of your app is better than a simple tcp check, i.e.
HTTP/1.(0|1) (200|404|403)would check for a HTTP/1.0 or HTTP/1.1 response, accepting response codes 200, 404 and 403 - for whatever reason this may make sense...
A better approach is a built-in health check in your applications, where the application owner has created an health endpoint, which is callable via HTTP, i.e.
curl -vk https//192.168.10.15/status/healthreturns
HTTP/1.1 200 OK ... Content-Type: application/json {"status": "ok"}
These are just some ideas, based on you questions. From my experience such advanced monitors are rare. In the cases I know of, they are mostly simple monitors that only check for response status code 200.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
