sensu-plugins-influxdb-metrics-checker 0.2.0 → 0.2.1

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: ccb29431c1bbb430e550f511a497e1d8e1d931af
4
- data.tar.gz: 306719c980c7af31026af1d391780ca6d7a932c5
3
+ metadata.gz: fe60799563f025075be685429026d01164be54a2
4
+ data.tar.gz: 4e1b65bedb39167ae07df9e8ac79f5248e12378e
5
5
  SHA512:
6
- metadata.gz: 0a1c31569b1db373c41bd42d5cc6c28535224def9823b4fe1c6ca0eddbfd3f50862a2d9e1eefa35ab9e54c289fa0076a4069771712a72191d8e35a4d106b8fe0
7
- data.tar.gz: 2b415e127ebb09a7c6fdfe843aa86c3231202be2b5c855b2a971a4d0ef1021946151813bf343e5522f776afcbb19a79218fb7786fe369fde3aa5931037e4e006
6
+ metadata.gz: 0fbccdbcd99caa5d8a53ae28879faf6ec50753c9d593e2dea2e9024c30e297987b165669d4488924e7a313b5bb77958999afb51e4acd415891a18540fade14ce
7
+ data.tar.gz: 720e9cc1537a845dd63742aa7cdc8ef477de1d8d7d8bc21ae103adfd3221cb74ba8aa79c1d7fbba72798ee112a65666f5d4b58e23f58cb4867302449c76cb32a
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
+ # [0.2.1] - 2016-11-21
7
+ ### Added
8
+ - third release
9
+ Fixing refactor
10
+
6
11
  # [0.2.0] - 2016-11-21
7
12
  ### Added
8
13
  - second release
@@ -15,4 +20,5 @@ Leaving 5 minutes to the data to consolidate.
15
20
  - initial release
16
21
 
17
22
  [0.1.0]: https://github.com/pliyosenpai/sensu-plugins-influxdb-metrics-checker/0.1.0...0.2.0
18
- [0.2.0]: https://github.com/pliyosenpai/sensu-plugins-influxdb-metrics-checker/0.2.0...HEAD
23
+ [0.2.0]: https://github.com/pliyosenpai/sensu-plugins-influxdb-metrics-checker/0.2.0...0.2.1
24
+ [0.2.1]: https://github.com/pliyosenpai/sensu-plugins-influxdb-metrics-checker/0.2.1...HEAD
data/README.md CHANGED
@@ -13,7 +13,8 @@ The result is that now we are able to experiment with our metrics and alerts, gi
13
13
  ## What it does
14
14
  The script will compare the values of yesterday at this time minus 10 minutes, with the values of today at this time minus 10 minus.
15
15
  It will calculate the percentage of difference and will act on that.
16
- You will be able set a threshold of warning and critical values where your program will act.
16
+ You will be able to set a threshold of warning and critical values where your program will act.
17
+ It will also leave it 5 minutes to aggregate the data in influxdb, so we are more precise.
17
18
 
18
19
  ## Components
19
20
  There is just one script that you can find at
@@ -33,9 +34,9 @@ Once in Sensu:
33
34
  /opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby check-influxdb-metrics.rb --host=metrics-influxdb.internal.com --port=8086 --user=admin --password=password -c -3 -w -10 --db=statsd_metrics --metric=api.request.counter
34
35
  ```
35
36
 
36
- If you have environments you can filter them by doing:
37
+ If you have a tag you can filter your metrics by doing, for example:
37
38
  ```
38
- ruby check-influxdb-metrics.rb --host=metrics-influxdb.service.veinternal.com --port=8086 --user=admin --password=password -c -20 -w -10 --db=statsd_metrics --metric=datareceivers.request.counter --env=datacenter --filter=ci
39
+ ruby check-influxdb-metrics.rb --host=metrics-influxdb.service.veinternal.com --port=8086 --user=admin --password=password -c -20 -w -10 --db=statsd_metrics --metric=datareceivers.request.counter --tag=datacenter --filter=ci
39
40
 
40
41
  ```
41
42
 
@@ -70,7 +70,7 @@ class CheckInfluxDbMetrics < Sensu::Plugin::Check::CLI
70
70
  long: '--metric=VALUE',
71
71
  description: 'Metric to influx DB. Ex datareceivers.messages.count'
72
72
 
73
- option :env,
73
+ option :tag,
74
74
  long: '--tag=VALUE',
75
75
  description: 'Filter by tag if provided.'
76
76
 
@@ -85,8 +85,7 @@ class CheckInfluxDbMetrics < Sensu::Plugin::Check::CLI
85
85
  end
86
86
 
87
87
  def filter_by_environment_when_needed
88
- return unless !config[:tag].nil? && !config[:filter].nil?
89
- " AND \"#{config[:tag]}\" =~ /#{config[:filter]}/"
88
+ config[:tag].nil? && config[:filter].nil? ? '' : " AND \"#{config[:tag]}\" =~ /#{config[:filter]}/"
90
89
  end
91
90
 
92
91
  def yesterday_query # Reads the value from 10 minutes before yesterday at this time.
@@ -170,6 +169,6 @@ class CheckInfluxDbMetrics < Sensu::Plugin::Check::CLI
170
169
  rescue RestClient::RequestTimeout
171
170
  critical 'InfluxDB Connection timed out'
172
171
  rescue StandardError => e
173
- unknown 'An exception occurred:' + e.message
172
+ unknown 'An exception occurred:' + e.message + e.stacktrace
174
173
  end
175
174
  end
@@ -2,7 +2,7 @@ module SensuPluginsInfluxDbMetricsChecker
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
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-metrics-checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanjo Guerrero Cerezuela