sensu-plugins-jenkins 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/bin/check-jenkins-health.rb +32 -9
- data/lib/sensu-plugins-jenkins/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d9455eef0d25ddd14e51eb5209f2744654e1efb0a01fbd401092969d58d1b2
|
4
|
+
data.tar.gz: 4c0556da90432d42b4acf3f3ea19d8ea80daf5e27e069d06a9c1f4ce8ad5aedc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 081c258532dcf13405f594854c949e7d54e5777f0d5cc6489ca7c0ba48247aaa92ffdedb747e9f0e4c1ebfb1f702d351abc622e74476e362b4dbafa7b5d7b3b5
|
7
|
+
data.tar.gz: f80ca63be1d2a744e366f8d762276eb9a7987170dcfc0d6414a21eb0208841985757a305d68828f50d0bfcf6152fea3ca432f77e73bcad1473be9698b8ead1d0
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,14 @@ This CHANGELOG follows the format listed at [Our CHANGELOG Guidelines](https://g
|
|
5
5
|
Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
|
+
|
9
|
+
## [1.6.1] - 2018-03-01
|
10
|
+
### Fixed
|
11
|
+
- check-jenkins-health.rb: added various rescues to prevent from bricking (@mdzidic) (@majormoses)
|
12
|
+
|
13
|
+
### Added
|
14
|
+
- check-jenkins-health.rb: added `--verbose` option to allow user to control the output returned when you have an error (@majormoses)
|
15
|
+
|
8
16
|
## [1.6.0] - 2018-02-21
|
9
17
|
### Added
|
10
18
|
- check-jenkins.rb: Add --insecure parameter to allow self signed ssl certs
|
@@ -81,7 +89,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
81
89
|
### Added
|
82
90
|
- initial release
|
83
91
|
|
84
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.6.
|
92
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.6.1...HEAD
|
93
|
+
[1.6.1]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.6.0...1.6.1
|
85
94
|
[1.6.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.5.0...1.6.0
|
86
95
|
[1.5.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.4.0...1.5.0
|
87
96
|
[1.4.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.3.0...1.4.0
|
data/bin/check-jenkins-health.rb
CHANGED
@@ -75,19 +75,42 @@ class JenkinsMetricsHealthChecker < Sensu::Plugin::Check::CLI
|
|
75
75
|
proc: proc(&:to_i),
|
76
76
|
default: 5
|
77
77
|
|
78
|
+
option :verbose,
|
79
|
+
short: '-v',
|
80
|
+
long: '--verbose',
|
81
|
+
boolean: true,
|
82
|
+
description: 'Return more verbose errors',
|
83
|
+
default: false
|
84
|
+
|
78
85
|
def run
|
79
86
|
https ||= config[:https] ? 'https' : 'http'
|
80
87
|
testurl = "#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}"
|
81
88
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
89
|
+
begin
|
90
|
+
r = if config[:https] && config[:insecure]
|
91
|
+
RestClient::Resource.new(testurl, timeout: config[:timeout], verify_ssl: false)
|
92
|
+
elsif config[:https]
|
93
|
+
RestClient::Resource.new(testurl, timeout: config[:timeout], verify_ssl: true)
|
94
|
+
else
|
95
|
+
RestClient::Resource.new(testurl, timeout: config[:timeout])
|
96
|
+
end
|
97
|
+
if config[:verbose]
|
98
|
+
r.get
|
99
|
+
else
|
100
|
+
r.get { |response| response }
|
101
|
+
end
|
102
|
+
rescue RestClient::SSLCertificateNotVerified => e
|
103
|
+
critical "ssl verification failed: #{e.response}"
|
104
|
+
rescue RestClient::ServerBrokeConnection
|
105
|
+
critical "server broke the connection: #{e}"
|
106
|
+
rescue RestClient::RequestFailed => e
|
107
|
+
critical "request failed: #{e.response}"
|
108
|
+
rescue RestClient::ExceptionWithResponse => e
|
109
|
+
critical "failed to #{e.response}"
|
110
|
+
end
|
111
|
+
# if you have a 500 it will only reach here if you are not specifying `--verbose`
|
112
|
+
# as it will be caught by the rescue above
|
113
|
+
if [200, 500].include?(r.code)
|
91
114
|
healthchecks = JSON.parse(r)
|
92
115
|
healthchecks.each do |healthcheck, healthcheck_hash_value|
|
93
116
|
if healthcheck_hash_value['healthy'] != true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-jenkins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|