sensu-plugins / sensu-plugins-jenkins

This plugin provides native Jenkins instrumentation for monitoring and metrics collection, including: health, job status, metrics via `JQS`, and others.
http://sensu-plugins.io
MIT License
9 stars 18 forks source link

Parse health check JSON response in error case #19

Closed mnuessler closed 7 years ago

mnuessler commented 7 years ago

Pull Request Checklist

Is this in reference to an existing issue? #10

General

New Plugins

Purpose

The commit in #17 is not sufficient to provide meaningful error messages because it parses the JSON response only for status code 200. But when a health check fails a status code of 500 is returned. To get a meaningful error message, the JSON response needs to be parsed also for status code 500.

Known Compatablity Issues

None.