Jenkins Health Check URL

16,759 views
Skip to first unread message

Michael Chletsos

unread,
Jun 3, 2016, 12:34:11 PM6/3/16
to Jenkins Users
I have an authenticated Jenkins setup that I need to monitor that the service is up - that is all - I want to know if there is an endpoint that does not require authentication and returns a 2xx or 3xx response? A 4xx response will not work.

Baptiste Mathus

unread,
Jun 4, 2016, 9:37:42 AM6/4/16
to jenkins...@googlegroups.com
Either check the home page, or set up for example a token on some job that you know is here to stay so that you can call through a simple unauthenticated HTTP call?

My 2 cents

2016-06-03 18:34 GMT+02:00 Michael Chletsos <mpch...@gmail.com>:
I have an authenticated Jenkins setup that I need to monitor that the service is up - that is all - I want to know if there is an endpoint that does not require authentication and returns a 2xx or 3xx response? A 4xx response will not work.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/36f868a5-2502-4ecc-a6db-8d65cd9f5d00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

geoffroy...@gmail.com

unread,
Jun 5, 2016, 7:03:54 AM6/5/16
to Jenkins Users
You might try to check the /login endpoint, which is available for both authenticated and unauthenticated jenkins instance
BR

Luis Arias

unread,
Sep 4, 2016, 2:51:45 PM9/4/16
to Jenkins Users
Hi,  A URL that works for me is simply /robots.txt.  It's unlikely to change and returns a 200 if jenkins is up.  Not a realy health check but better than nothing!

Luis

Daniel Beck

unread,
Sep 4, 2016, 5:40:28 PM9/4/16
to jenkins...@googlegroups.com
A real health check is provided by https://wiki.jenkins-ci.org/display/JENKINS/Metrics+Plugin
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8b022b92-e8ff-4cab-82ec-30444d8babba%40googlegroups.com.

Stephen Connolly

unread,
Sep 6, 2016, 12:16:25 PM9/6/16
to jenkins...@googlegroups.com
That just checks if server container is running...

For a real *active* health check, install the metrics plugin.

FTR plugins can add additional health checks for reporting by the metrics plugin
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.


--
Sent from my phone

Luis Arias

unread,
Sep 7, 2016, 5:40:41 AM9/7/16
to Jenkins Users
Thanks all, that metrics plugin looks awesome and I will definitely look into it!  It's a bit over the top for our current setup but I'm putting on my list right now.

Luis 

Light Stark

unread,
Jun 5, 2017, 5:36:51 AM6/5/17
to Jenkins Users, m...@beckweb.net

Hey Daniel, After performing the check where does this plugin report the result of the check?
I am writing a http liveness probe and i need an endpoint url.  

John Hovell

unread,
Aug 1, 2017, 7:02:18 PM8/1/17
to Jenkins Users, m...@beckweb.net, aditya...@gmail.com

From the docs:


https://wiki.jenkins.io/display/JENKINS/Metrics+Plugin


"The Healthcheck servlet runs the healthchecks defined against the Metrics API and returns the detailed status in JSON (or JSONP) format, while the high level status is reported by the HTTP status code.

These servlets are protected by security controls in order to ensure that they are not abused"


So, not sure how to configure it for use with a load balancer / reverse proxy. Typically I've seen healthchecks that will not respond to a request that has an x-forwarded-for header. This allows the load balancer (or anyone with direct access to the server port) to call the healthcheck but not for any entity in front of a load balancer.

Stephen Connolly

unread,
Aug 2, 2017, 2:23:26 AM8/2/17
to jenkins...@googlegroups.com
On Wed 2 Aug 2017 at 00:02, John Hovell <jho...@sunrunhome.com> wrote:

From the docs:


https://wiki.jenkins.io/display/JENKINS/Metrics+Plugin


"The Healthcheck servlet runs the healthchecks defined against the Metrics API and returns the detailed status in JSON (or JSONP) format, while the high level status is reported by the HTTP status code.

These servlets are protected by security controls in order to ensure that they are not abused"


So, not sure how to configure it for use with a load balancer / reverse proxy. Typically I've seen healthchecks that will not respond to a request that has an x-forwarded-for header. This allows the load balancer (or anyone with direct access to the server port) to call the healthcheck but not for any entity in front of a load balancer.


Define a metrics api key in the global config.

Then access the health check using that key, e.g. Instead of https://jenkins.example.com/metrics/currentUser/... replace currentUser by the api key you generated

HTH 



On Monday, June 5, 2017 at 2:36:51 AM UTC-7, Light Stark wrote:

Hey Daniel, After performing the check where does this plugin report the result of the check?
I am writing a http liveness probe and i need an endpoint url.  
On Monday, September 5, 2016 at 3:10:28 AM UTC+5:30, Daniel Beck wrote:
A real health check is provided by https://wiki.jenkins-ci.org/display/JENKINS/Metrics+Plugin


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Stephen Connolly

unread,
Aug 2, 2017, 2:28:55 AM8/2/17
to jenkins...@googlegroups.com
Inline images 1

On 2 August 2017 at 07:22, Stephen Connolly <stephen.al...@gmail.com> wrote:
On Wed 2 Aug 2017 at 00:02, John Hovell <jho...@sunrunhome.com> wrote:

From the docs:


https://wiki.jenkins.io/display/JENKINS/Metrics+Plugin


"The Healthcheck servlet runs the healthchecks defined against the Metrics API and returns the detailed status in JSON (or JSONP) format, while the high level status is reported by the HTTP status code.

These servlets are protected by security controls in order to ensure that they are not abused"


So, not sure how to configure it for use with a load balancer / reverse proxy. Typically I've seen healthchecks that will not respond to a request that has an x-forwarded-for header. This allows the load balancer (or anyone with direct access to the server port) to call the healthcheck but not for any entity in front of a load balancer.


Define a metrics api key in the global config.

Then access the health check using that key, e.g. Instead of https://jenkins.example.com/metrics/currentUser/... replace currentUser by the api key you generated

HTH 



On Monday, June 5, 2017 at 2:36:51 AM UTC-7, Light Stark wrote:

Hey Daniel, After performing the check where does this plugin report the result of the check?
I am writing a http liveness probe and i need an endpoint url.  
On Monday, September 5, 2016 at 3:10:28 AM UTC+5:30, Daniel Beck wrote:
A real health check is provided by https://wiki.jenkins-ci.org/display/JENKINS/Metrics+Plugin


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.

Felipe Santos

unread,
Mar 12, 2025, 5:33:58 PMMar 12
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages