sensu-plugins-influxdb 1.0.0 → 1.1.0
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 +10 -1
- data/README.md +46 -2
- data/bin/check-influxdb-query.rb +8 -0
- data/bin/mutator-influxdb-line-protocol.rb +9 -2
- data/lib/sensu-plugins-influxdb/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9274a7f429a5773b2b87785eb228d28732f870ba
|
4
|
+
data.tar.gz: 181b6d9c4d45098cfe3a9d5d2ac479b69da97b09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2825358b70d0459f0a51362dce642f3869135fb720a353b7d7f83c65ff6cfb1b96928c45f3eee13576b596207e9a0c0b5d70da16a6714dbc91ab8480fad6bc
|
7
|
+
data.tar.gz: 615ebd06c4d6ee7365689df7f16e72777af450e2dd021ea9eae4227a7ce840c02478b54837bb173a541acafafad711b3d610f5c0b0a70396bedf53bd9b53488c
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,14 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.1.0] - 2016-12-01
|
9
|
+
### Added
|
10
|
+
- Added tags support for mutator-influxdb-line-protocol.rb
|
11
|
+
- Added retry support for check-influxdb-query.rb - The InfluxDB gem by default retries indefinitely and will cause the query to hang. A retry of 12 will retry for approx 37 seconds.
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- Update to `influxdb` gem 0.3.13
|
15
|
+
|
8
16
|
## [1.0.0] - 2016-10-06
|
9
17
|
### Added
|
10
18
|
- Ruby 2.3.0 support
|
@@ -58,7 +66,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
58
66
|
### Added
|
59
67
|
- initial release
|
60
68
|
|
61
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-influxdb/compare/1.
|
69
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-influxdb/compare/1.1.0...HEAD
|
70
|
+
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-influxdb/compare/1.0.0...1.1.0
|
62
71
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-influxdb/compare/0.0.7...1.0.0
|
63
72
|
[0.0.7]: https://github.com/sensu-plugins/sensu-plugins-influxdb/compare/0.0.6...0.0.7
|
64
73
|
[0.0.6]: https://github.com/sensu-plugins/sensu-plugins-influxdb/compare/0.0.5...0.0.6
|
data/README.md
CHANGED
@@ -12,8 +12,9 @@
|
|
12
12
|
* bin/check-influxdb.rb
|
13
13
|
* bin/check-influxdb-query.rb
|
14
14
|
* bin/metrics-influxdb.rb
|
15
|
+
* bin/mutator-influxdb-line-protocol.rb
|
15
16
|
|
16
|
-
## Usage
|
17
|
+
## Usage - metrics-influxdb.rb
|
17
18
|
Add the following to `/etc/sensu/conf.d/influx.conf` "plugin expects `influxdb` to be a top level node in the json
|
18
19
|
**metrics-influxdb**
|
19
20
|
```
|
@@ -53,10 +54,53 @@ Then add the following to your `/ect/sensu/conf.d/handlers.conf`:
|
|
53
54
|
}
|
54
55
|
}
|
55
56
|
```
|
56
|
-
To ship additional tags to your metrics via metrics-influxdb.rb (only available in influxdb >= 0.9), just add a tags block inside your check.
|
57
57
|
|
58
58
|
Setting "status" to true will store the metric using the status as the value and the check name as the series
|
59
59
|
|
60
|
+
## Usage - mutator-influxdb-line-protocol.rb
|
61
|
+
Add the mutator-influxdb-line-protocol.rb file into /etc/sensu/extensions/
|
62
|
+
|
63
|
+
Then add the following to your `/ect/sensu/conf.d/handlers.conf`:
|
64
|
+
```
|
65
|
+
{
|
66
|
+
"handlers": {
|
67
|
+
"influxdb_udp": {
|
68
|
+
"type": "udp",
|
69
|
+
"socket": {
|
70
|
+
"host": "localhost",
|
71
|
+
"port": 8090
|
72
|
+
},
|
73
|
+
"mutator": "influxdb_line_protocol",
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
```
|
78
|
+
|
79
|
+
## Check configuration
|
80
|
+
To ship additional tags to your metrics via mutator-influxdb-line-protocol.rb (only available in influxdb >= 0.9), just add a tags block inside your check.
|
81
|
+
|
82
|
+
```
|
83
|
+
{
|
84
|
+
"checks": {
|
85
|
+
"cpu-metrics": {
|
86
|
+
"command": "/opt/sensu/embedded/bin/metrics-cpu-pcnt-usage.rb",
|
87
|
+
"handlers": [
|
88
|
+
"influxdb_udp"
|
89
|
+
],
|
90
|
+
"interval": 60,
|
91
|
+
"subscribers": [
|
92
|
+
"base"
|
93
|
+
],
|
94
|
+
"type": "metric",
|
95
|
+
"standalone": false,
|
96
|
+
"tags": {
|
97
|
+
"group": "operations",
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
```
|
103
|
+
|
60
104
|
## Installation
|
61
105
|
|
62
106
|
[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
|
data/bin/check-influxdb-query.rb
CHANGED
@@ -79,6 +79,13 @@ class CheckInfluxdbQuery < Sensu::Plugin::Check::CLI
|
|
79
79
|
default: 'influxdb',
|
80
80
|
description: 'InfluxDB database name'
|
81
81
|
|
82
|
+
option :retry,
|
83
|
+
short: '-r RETRY',
|
84
|
+
long: '--retry RETRY',
|
85
|
+
description: 'InfluxDB retry count with exponential back-off',
|
86
|
+
proc: proc(&:to_i),
|
87
|
+
default: 12
|
88
|
+
|
82
89
|
option :username,
|
83
90
|
short: '-u USERNAME',
|
84
91
|
long: '--username USERNAME',
|
@@ -152,6 +159,7 @@ class CheckInfluxdbQuery < Sensu::Plugin::Check::CLI
|
|
152
159
|
use_ssl: config[:use_ssl],
|
153
160
|
verify_ssl: config[:verify_ssl],
|
154
161
|
ssl_ca_cert: config[:ssl_ca_cert],
|
162
|
+
retry: config[:retry],
|
155
163
|
username: config[:username],
|
156
164
|
password: config[:password]
|
157
165
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# {
|
12
12
|
# "influxdb_udp": {
|
13
13
|
# "type": "udp",
|
14
|
-
# "mutator": "
|
14
|
+
# "mutator": "influxdb_line_protocol",
|
15
15
|
# "socket": {
|
16
16
|
# "host": "mgt-monitor-db1",
|
17
17
|
# "port": 8090
|
@@ -33,6 +33,7 @@ module Sensu
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def run(event)
|
36
|
+
tags = event[:check][:tags]
|
36
37
|
host = event[:client][:name]
|
37
38
|
metric = event[:check][:name]
|
38
39
|
output = event[:check][:output]
|
@@ -45,7 +46,13 @@ module Sensu
|
|
45
46
|
key.tr!('.', '_')
|
46
47
|
value = m[1].to_f
|
47
48
|
time = m[2].ljust(19, '0')
|
48
|
-
|
49
|
+
linedata = "#{key},host=#{host},metric=#{metric}"
|
50
|
+
if tags
|
51
|
+
tags.each do |tagname, tagvalue|
|
52
|
+
linedata << ",#{tagname}=#{tagvalue}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
data << "#{linedata} value=#{value} #{time}"
|
49
56
|
end
|
50
57
|
|
51
58
|
yield data.join("\n"), 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-influxdb
|
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: 2016-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dentaku
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3.
|
33
|
+
version: 0.3.13
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.3.
|
40
|
+
version: 0.3.13
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jsonpath
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
241
|
version: '0'
|
242
242
|
requirements: []
|
243
243
|
rubyforge_project:
|
244
|
-
rubygems_version: 2.5
|
244
|
+
rubygems_version: 2.4.5
|
245
245
|
signing_key:
|
246
246
|
specification_version: 4
|
247
247
|
summary: Sensu plugins for influxdb
|