sensu-plugins-influxdb 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec209e3360b44cc83697818a5c19d93ed8466fa5
4
- data.tar.gz: aa0a0f10accf7e58c5aeda689b43494e0abe40d6
3
+ metadata.gz: 2c2865ca231332d9ea2177ff7bf8cc81440750d9
4
+ data.tar.gz: b630343c0021124c0d2d0d53273d84802f9bf16f
5
5
  SHA512:
6
- metadata.gz: b227625ca89bb05eb8e7ebd8a0260f38b67e6df94d49a55587edc6bdf4b8c588d36d1d66c21135d94d5c3e420dcad85bd5b8131eb8ea4417cf627efed326f13c
7
- data.tar.gz: e9d54190bd57e31deb5fbaa998be0978e55f55ed16cced478ba5e2a0c22feba9ebacff427efe615c35f35115e5ca877f44a2d1e2afc1a2e7576432243f99ee69
6
+ metadata.gz: 045e6e8d6412bfb22a3f8cf46136b6b6715e07296e0b5261903c2d3cb3f5724417396b18b79b1a1930c3d8590c59e4c7e5fc303ccb9a358cb95fa27590096d86
7
+ data.tar.gz: d38e0e8610737c96cc647700e95530043a53c0c071d40cd276648eb5af9f0325c96eed3c86ef2587de829b54b308fdd2cf9053008f6e7dda50b4f43a135a18c9
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -4,9 +4,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## Unreleased
7
- - nothing
8
7
 
9
- ### [0.0.3] - 2015-08-10
8
+ ### [0.0.5] - 2015-10-19
9
+ - added support for https in check-influxdb.
10
+ - pass ssl arguments to the influxdb object in check-influxdb-query.
11
+ - renamed the config option in check-influxdb from ssl to verify_ssl.
12
+ - changed README to update the config option ssl_ca_cert.
13
+
14
+ ### [0.0.4] - 2015-08-10
10
15
  - updated metrics-influxdb.rb to symbolize keys for InfluxDB::Client
11
16
  - updated influxdb gem to 0.2.2
12
17
  - updated metrics-influxdb.rb to support influxdb 0.9.x
data/README.md CHANGED
@@ -18,27 +18,27 @@
18
18
  **metrics-influxdb**
19
19
  ```
20
20
  {
21
- "influxdb" : {
22
- "hosts" : ["influxdb.familyguy.com", ],
23
- "host" : "influxdb.familyguy.com",
24
- "port" : "8086",
25
- "username" : "root",
26
- "password" : "root",
27
- "database" : "stats"
28
- # OPTIONAL
29
- "time_precision" : "s",
30
- "use_ssl : false,
31
- "verify_ssl : true,
32
- "ssl_ca_cert : false,
33
- "auth_method : "params",
34
- "initial_delay : 0.01,
35
- "max_delay : 30,
36
- "open_timeout : 5,
37
- "read_timeout : 300,
38
- "retry : nil,
39
- "prefix : '',
40
- "denormalize : true
41
- }
21
+ "influxdb": {
22
+ "hosts" : ["influxdb.familyguy.com"],
23
+ "host" : "influxdb.familyguy.com",
24
+ "port" : "8086",
25
+ "username" : "root",
26
+ "password" : "root",
27
+ "database" : "stats",
28
+ # OPTIONAL
29
+ "time_precision": "s",
30
+ "use_ssl" : false,
31
+ "verify_ssl" : true,
32
+ "ssl_ca_cert" : "path to the ca certificate file",
33
+ "auth_method" : "params",
34
+ "initial_delay" : 0.01,
35
+ "max_delay" : 30,
36
+ "open_timeout" : 5,
37
+ "read_timeout" : 300,
38
+ "retry" : null,
39
+ "prefix" : "",
40
+ "denormalize" : true
41
+ }
42
42
  }
43
43
  ```
44
44
 
@@ -54,6 +54,25 @@ class CheckInfluxdbQuery < Sensu::Plugin::Check::CLI
54
54
  default: '8086',
55
55
  description: 'InfluxDB port'
56
56
 
57
+ option :use_ssl,
58
+ description: 'Turn on/off SSL (default: false)',
59
+ short: '-s',
60
+ long: '--use_ssl',
61
+ boolean: true,
62
+ default: false
63
+
64
+ option :verify_ssl,
65
+ description: 'Turn on/off using SSL certificate (default: false)',
66
+ short: '-v',
67
+ long: '--verify_ssl',
68
+ boolean: true,
69
+ default: false
70
+
71
+ option :ssl_ca_cert,
72
+ description: 'Path to the ssl ca certificate to connect to the InfluxDB server',
73
+ short: '-c CA_CERT',
74
+ long: '--ssl_ca_cert CA_CERT'
75
+
57
76
  option :database,
58
77
  short: '-d DATABASE',
59
78
  long: '--database DATABASE',
@@ -130,6 +149,9 @@ class CheckInfluxdbQuery < Sensu::Plugin::Check::CLI
130
149
  influxdb = InfluxDB::Client.new config[:database],
131
150
  host: config[:host],
132
151
  port: config[:port],
152
+ use_ssl: config[:use_ssl],
153
+ verify_ssl: config[:verify_ssl],
154
+ ssl_ca_cert: config[:ssl_ca_cert],
133
155
  username: config[:username],
134
156
  password: config[:password]
135
157
 
@@ -13,8 +13,6 @@
13
13
  #
14
14
  # DEPENDENCIES:
15
15
  # gem: sensu-plugin
16
- # gem: uri
17
- # gem: json
18
16
  #
19
17
  # USAGE:
20
18
  # #YELLOW
@@ -28,9 +26,7 @@
28
26
  #
29
27
 
30
28
  require 'sensu-plugin/check/cli'
31
- require 'net/http'
32
- require 'uri'
33
- require 'json'
29
+ require 'net/https'
34
30
 
35
31
  #
36
32
  # Check InfluxDB
@@ -49,13 +45,25 @@ class CheckInfluxDB < Sensu::Plugin::Check::CLI
49
45
  proc: proc(&:to_i),
50
46
  default: 8086
51
47
 
52
- option :ssl,
48
+ option :use_ssl,
53
49
  description: 'Turn on/off SSL (default: false)',
54
50
  short: '-s',
55
- long: '--ssl',
51
+ long: '--use_ssl',
56
52
  boolean: true,
57
53
  default: false
58
54
 
55
+ option :verify_ssl,
56
+ description: 'Turn on/off using SSL certificate (default: false)',
57
+ short: '-v',
58
+ long: '--verify_ssl',
59
+ boolean: true,
60
+ default: false
61
+
62
+ option :ssl_ca_cert,
63
+ description: 'Path to the ssl ca certificate to connect to the InfluxDB server',
64
+ short: '-c CA_CERT',
65
+ long: '--ssl_ca_cert CA_CERT'
66
+
59
67
  option :timeout,
60
68
  description: 'Seconds to wait for the connection to open or read (default: 1.0s)',
61
69
  short: '-t SECONDS',
@@ -67,7 +75,13 @@ class CheckInfluxDB < Sensu::Plugin::Check::CLI
67
75
  http = Net::HTTP.new(config[:host], config[:port])
68
76
  http.open_timeout = config[:timeout]
69
77
  http.read_timeout = config[:timeout]
70
- http.use_ssl = config[:ssl]
78
+ http.use_ssl = config[:use_ssl]
79
+ if config[:verify_ssl]
80
+ http.ca_file = config[:ssl_ca_cert]
81
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
82
+ else
83
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
84
+ end
71
85
  http.start do
72
86
  response = http.get('/ping')
73
87
  status_line = "#{response.code} #{response.message}"
@@ -2,7 +2,7 @@ module SensuPluginsInfluxdb
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
@@ -30,7 +30,7 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-08-10 00:00:00.000000000 Z
33
+ date: 2015-10-20 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: dentaku
@@ -214,7 +214,11 @@ dependencies:
214
214
  - - "~>"
215
215
  - !ruby/object:Gem::Version
216
216
  version: '0.8'
217
- description: Sensu plugins for influxDB
217
+ description: |-
218
+ This plugin provides native InfluxDB instrumentation
219
+ for monitoring and metrics collection, including:
220
+ service health via `/ping`, running queries, and service
221
+ metrics
218
222
  email: "<sensu-users@googlegroups.com>"
219
223
  executables:
220
224
  - metrics-influxdb.rb
metadata.gz.sig CHANGED
Binary file