sensu-plugins-springboot 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +13 -1
- data/bin/metrics-springboot.rb +43 -13
- data/lib/sensu-plugins-springboot/version.rb +1 -1
- metadata +45 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9ca2a212734404edb77929a04af4534ae43c70fc3ea527434a3a38810a47555d
|
4
|
+
data.tar.gz: 1d045425c9cea4ce2baaa2963104597834b6796d4fa2d4519d3cc5e3eb307dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68d890f176f2bbafa86eb43d9a3fbf13e2d3393a8cb30dee3c4f265d3e2bf97b4359e6a6ad39a90c527124fdf02cdb4abbb5e218b2729fdc6150e1482b787056
|
7
|
+
data.tar.gz: 30cbe0c4c0bdfbf40fc55ee4344124b58068024711e9c2a2dfac28a2cb48c6d1bc0980e4af30c224017b2a3003c4e11c4e7a50c64758a280feb3dfcb275e66c2
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
-
This CHANGELOG follows the format listed
|
4
|
+
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.1.0] - 2018-01-24
|
9
|
+
### Added
|
10
|
+
- metrics-springboot.rb: new option `--protocol` to allow specifying https connection for requests (@seanrobb)
|
11
|
+
- metrics-springboot.rb: new option `--url` to be used as a single parameter instead of specifying `--protocol`, `--host`, `--port`, and `--path` (@seanrobb)
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- updated changelog guidelines location (@majormoses)
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- spelling in PR template (@majormoses)
|
18
|
+
|
8
19
|
## [1.0.0] - 2017-06-25
|
9
20
|
### Added
|
10
21
|
- Support for Ruby 2.3 and 2.4 (@eheydrick)
|
@@ -32,6 +43,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
32
43
|
- initial release
|
33
44
|
|
34
45
|
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-springboot/compare/1.0.0...HEAD
|
46
|
+
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-springboot/compare/1.0.0...1.1.0
|
35
47
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-springboot/compare/0.0.3...1.0.0
|
36
48
|
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-springboot/compare/0.0.2...0.0.3
|
37
49
|
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-springboot/compare/0.0.1...0.0.2
|
data/bin/metrics-springboot.rb
CHANGED
@@ -27,6 +27,11 @@
|
|
27
27
|
# springboot-metrics.rb --host=192.168.1.1 &
|
28
28
|
# --port=8081 &
|
29
29
|
# --username=admin --password=secret --path=/metrics
|
30
|
+
# Use with insecure SSL:
|
31
|
+
# springboot-metrics.rb --host=192.168.1.1 &
|
32
|
+
# --port=443 &
|
33
|
+
# --username=admin --password=secret &
|
34
|
+
# --path=/metrics --insecure --protocol http
|
30
35
|
#
|
31
36
|
# NOTES:
|
32
37
|
# Check with Spring Boot 1.2.0 actuator endpoints
|
@@ -44,20 +49,47 @@ require 'json'
|
|
44
49
|
require 'uri'
|
45
50
|
|
46
51
|
class SpringBootMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
52
|
+
option :url,
|
53
|
+
short: '-u URL',
|
54
|
+
long: '--url URL',
|
55
|
+
description: 'The url for your app metrics',
|
56
|
+
required: false
|
57
|
+
|
47
58
|
option :host,
|
48
59
|
short: '-h HOST',
|
49
60
|
long: '--host HOST',
|
50
61
|
description: 'Your spring boot actuator endpoint',
|
51
|
-
required:
|
62
|
+
required: false,
|
52
63
|
default: 'localhost'
|
53
64
|
|
54
65
|
option :port,
|
55
66
|
short: '-P PORT',
|
56
67
|
long: '--port PORT',
|
57
68
|
description: 'Your app port',
|
58
|
-
required:
|
69
|
+
required: false,
|
59
70
|
default: 8080
|
60
71
|
|
72
|
+
option :path,
|
73
|
+
short: '-e PATH',
|
74
|
+
long: '--path PATH',
|
75
|
+
description: 'Metrics endpoint path',
|
76
|
+
required: false,
|
77
|
+
default: '/metrics'
|
78
|
+
|
79
|
+
option :protocol,
|
80
|
+
short: '-l PROTO',
|
81
|
+
long: '--protocol PROTO',
|
82
|
+
description: 'The protocol used to make requests',
|
83
|
+
in: %w(http https),
|
84
|
+
default: 'http'
|
85
|
+
|
86
|
+
option :insecure,
|
87
|
+
short: '-k',
|
88
|
+
long: '--insecure',
|
89
|
+
description: 'Insecure SSL Certificate',
|
90
|
+
boolean: true,
|
91
|
+
default: false
|
92
|
+
|
61
93
|
option :username,
|
62
94
|
short: '-u USERNAME',
|
63
95
|
long: '--username USERNAME',
|
@@ -70,13 +102,6 @@ class SpringBootMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
70
102
|
description: 'Your app password',
|
71
103
|
required: false
|
72
104
|
|
73
|
-
option :path,
|
74
|
-
short: '-e PATH',
|
75
|
-
long: '--path PATH',
|
76
|
-
description: 'Metrics endpoint path',
|
77
|
-
required: true,
|
78
|
-
default: '/metrics'
|
79
|
-
|
80
105
|
option :scheme,
|
81
106
|
description: 'Metric naming scheme, text to prepend to metric',
|
82
107
|
short: '-s SCHEME',
|
@@ -106,12 +131,17 @@ class SpringBootMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
106
131
|
end
|
107
132
|
|
108
133
|
def run
|
109
|
-
|
110
|
-
|
134
|
+
unless config[:url]
|
135
|
+
config[:url] = "#{config[:protocol]}://#{config[:host]}:#{config[:port]}#{config[:path]}"
|
136
|
+
end
|
137
|
+
|
138
|
+
uri = URI.parse(config[:url])
|
139
|
+
|
140
|
+
verify_mode = config[:insecure] ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
|
111
141
|
|
112
142
|
begin
|
113
|
-
res = Net::HTTP.start(
|
114
|
-
req = Net::HTTP::Get.new(
|
143
|
+
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https', verify_mode: verify_mode) do |http|
|
144
|
+
req = Net::HTTP::Get.new(uri.path)
|
115
145
|
if config[:username] && config[:password]
|
116
146
|
req.basic_auth(config[:username], config[:password])
|
117
147
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-springboot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.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:
|
11
|
+
date: 2018-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -52,6 +52,48 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rdoc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: rubocop
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
231
|
version: '0'
|
190
232
|
requirements: []
|
191
233
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.4
|
234
|
+
rubygems_version: 2.7.4
|
193
235
|
signing_key:
|
194
236
|
specification_version: 4
|
195
237
|
summary: Sensu plugins for Springboot
|