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

3

8

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.

Esurient answered 12/6, 2012 at 10:5 Comment(0)
D
4

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.

Duaneduarchy answered 12/6, 2012 at 10:20 Comment(0)
P
1

Could also use curl:

while [[ $(curl -s -w "%{http_code}" http://server -o /dev/null) != "200" ]]; do
  sleep 5
done
Prager answered 6/5, 2015 at 16:9 Comment(0)
B
0

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.

Brittle answered 11/9, 2020 at 10:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.