How to check if jenkins are fully up and running using webservice?

I want to know how to check if jenkins are fully up and running using webservice?

I want to use jenkins webservice to verify this. Is there any way to do this?

Thanks.

+4
source share
2 answers

Probably the easiest way would be to do simple HTTP access to the root URL of the Jenkins server. You get a successful status (200) if Jenkins is completely ready. If this is not the case, you will receive 503 - Service Temporarily Unavailable (or possibly other errors depending on the specific situation).

At the command line, you can use a tool like wget to execute this request.

+3
source

You can also use curl:

 while [[ $(curl -s -w "%{http_code}" http://server -o /dev/null) != "200" ]]; do sleep 5 done 
+1
source

All Articles