sensu-plugins-influxdb-metrics-checker 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +4 -3
- data/bin/check-influxdb-metrics.rb +3 -4
- data/lib/sensu-plugins-influxdb-metrics-checker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe60799563f025075be685429026d01164be54a2
|
4
|
+
data.tar.gz: 4e1b65bedb39167ae07df9e8ac79f5248e12378e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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...
|
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
|
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 --
|
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 :
|
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
|
-
|
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
|