sensu-plugins-jenkins 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/bin/check-jenkins-health.rb +16 -9
- data/lib/sensu-plugins-jenkins/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64b5b8a76d01460965176f93d822b9cdc785bd76
|
4
|
+
data.tar.gz: 79716dccf7d33ae4647d189650d2b58365633e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85ac99750ad5ca0763e2c6d5d2b406bf8d1a7f96b3abc6f70c3fa8c61d0991591481038d3a4f7d7dd0412db2345cbde4dd8c529c75d893cff3d00257aaab2b4f
|
7
|
+
data.tar.gz: e5d326f19100d1af096927a8bf422d1523d6129deb37a182eb706d35cf53391838f3fd1fd7b83b78f4c09ab60bce20204ea1211f6fcf06026d0d90de4db8dfc5
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.2.0] - 2016-11-11
|
9
|
+
### Added
|
10
|
+
- Additional information given on errors in check-jenkins-health.rb
|
11
|
+
- Add configuration option for timeout in check-jenkins-health.rb
|
12
|
+
|
8
13
|
## [1.1.0] - 2016-10-06
|
9
14
|
### Added
|
10
15
|
- Added authentication options to check-jenkins-build-time.rb and check-jenkins-job-status.rb
|
@@ -23,7 +28,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
23
28
|
|
24
29
|
## [0.1.0] - 2015-12-14
|
25
30
|
### Added
|
26
|
-
- Enhanced error messages in particular when the check configuration is wrong
|
31
|
+
- Enhanced error messages in particular when the check configuration is wrong
|
27
32
|
- Update dependent jenkins-api version to 1.4.2
|
28
33
|
- Changed check-jenkins-job-status.rb and check-jenkins-build-time.rb to use server_url to allow
|
29
34
|
passing credentials
|
@@ -51,7 +56,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
51
56
|
### Added
|
52
57
|
- initial release
|
53
58
|
|
54
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.
|
59
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.2.0...HEAD
|
60
|
+
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.1.0...1.2.0
|
55
61
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/1.0.0...1.1.0
|
56
62
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/0.1.0...1.0.0
|
57
63
|
[0.1.0]: https://github.com/sensu-plugins/sensu-plugins-jenkins/compare/0.0.5...0.1.0
|
data/bin/check-jenkins-health.rb
CHANGED
@@ -61,23 +61,30 @@ class JenkinsMetricsHealthChecker < Sensu::Plugin::Check::CLI
|
|
61
61
|
description: 'Enabling https connections',
|
62
62
|
default: false
|
63
63
|
|
64
|
+
option :timeout,
|
65
|
+
short: '-t SECS',
|
66
|
+
long: '--timeout SECS',
|
67
|
+
description: 'Request timeout in seconds',
|
68
|
+
proc: proc(&:to_i),
|
69
|
+
default: 5
|
70
|
+
|
64
71
|
def run
|
65
72
|
https ||= config[:https] ? 'https' : 'http'
|
66
|
-
r = RestClient::Resource.new("#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}", timeout:
|
67
|
-
if r.code
|
73
|
+
r = RestClient::Resource.new("#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}", timeout: config[:timeout]).get
|
74
|
+
if [200, 500].include? r.code
|
68
75
|
healthchecks = JSON.parse(r)
|
69
|
-
healthchecks.each do |
|
76
|
+
healthchecks.each do |healthcheck, healthcheck_hash_value|
|
70
77
|
if healthcheck_hash_value['healthy'] != true
|
71
|
-
critical
|
78
|
+
critical "Jenkins health check '#{healthcheck}' reported unhealthy state. Message: #{healthcheck_hash_value['message']}"
|
72
79
|
end
|
73
80
|
end
|
74
81
|
ok 'Jenkins Health Parameters are OK'
|
75
82
|
else
|
76
|
-
critical
|
83
|
+
critical "Jenkins Service is replying with status code #{r.code}. Body: #{r.body}"
|
77
84
|
end
|
78
|
-
rescue Errno::ECONNREFUSED
|
79
|
-
critical
|
80
|
-
rescue RestClient::RequestTimeout
|
81
|
-
critical
|
85
|
+
rescue Errno::ECONNREFUSED => e
|
86
|
+
critical "Jenkins Service is not responding: #{e}"
|
87
|
+
rescue RestClient::RequestTimeout => e
|
88
|
+
critical "Jenkins Service Connection timed out after #{config[:timeout]} seconds: #{e}"
|
82
89
|
end
|
83
90
|
end
|
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.
|
4
|
+
version: 1.2.0
|
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: 2016-
|
11
|
+
date: 2016-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.
|
247
|
+
rubygems_version: 2.4.8
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Sensu plugins for jenkins
|