Muthu
Muthu

Reputation: 1550

How to check whether jenkins is fully up and running using webservice ?

I want to know , how to check whether jenkins is fully up and running using webservice ?

i want to use jenkins webservice to check this. Is there any way to do this ?

Thanks.

Upvotes: 8

Views: 18906

Answers (3)

In addition to previous answers: If security is enabled, you will get HTTP 403 from the root URL. To get HTTP 200, you can check http://server/login.

Upvotes: 0

codecraig
codecraig

Reputation: 3158

Could also use curl:

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

Upvotes: 1

malenkiy_scot
malenkiy_scot

Reputation: 16605

Probably the easiest way would be to perform a simple HTTP get on the Jenkins server root URL. You get a successful status (200) if Jenkins is fully up. If it is not you'll get 503 - Service Temporarily Unavailable (or possibly other errors depending on specific situation).

From the command line you can use a tool such as wget to perform that request.

Upvotes: 4

Related Questions