sensu-plugins-riak 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 45a0b1de454d78e132ea08de319990f01f06efc6
4
- data.tar.gz: e46e8aed4e5ed2aa9fd45dcc0a153fbbeec4b84b
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDY3NTYxYjk1N2E5MzQyMDYxYjIyNTMwNTgxYzU5OWMyZThhNDg2Mw==
5
+ data.tar.gz: !binary |-
6
+ MmQwMTIwODg1OTAyNGM3MTFkYWIyZTIwNzdkMmI3YTFjMWNlZDI2NA==
5
7
  SHA512:
6
- metadata.gz: ac932dada5956671d79d8b7c327e1635d1a1aab46e55b411f0794debcc4e28d2b43bd24c2d0ace6e47008f8846a557f9b6ced71dff131183f7c3e32897b83d28
7
- data.tar.gz: 39378de42c235dd97e3aef3d85913acbb88cbc6f0dc983dcbfb62ea9d2fc125d575643808b2d3925b1c0844a79260e6cf243dd9025d7e8121a80c30b287d1f20
8
+ metadata.gz: !binary |-
9
+ NWUwNWY3YzdiMDQ3NWU5OGExMWY1MmIzMGI0NzFkYWJhMGI2ZmNjNTQ4NmI3
10
+ MDExMTUxOWI3MWJiMDVlYjQ0Yjk5YThlNGRhYWNjNTMxZTcwNmNjYjllNzE3
11
+ NGJmYmQ1M2E3Y2NlNmYxMzI1M2E3Nzg5ZjEwMDc3YzY4ODVkYTA=
12
+ data.tar.gz: !binary |-
13
+ ZDNlZWU5NzNiMzA2MmRkOTBlYjRmOThkMWQ1Yjg3YjViMTlmZTU2M2EwMjI0
14
+ M2M0ZDRlNDUzMzA3NWJlOWJmYmFhNTg3NWJhMDg0OGY1NDI1YTRhMmZmZmU3
15
+ Zjc5MjM1NTAwMjVkNDk2M2EwYmE4NDgxZDU3YTQ1YmQ0MmRmMzk=
data/CHANGELOG.md CHANGED
@@ -3,9 +3,14 @@ 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
- ## [Unreleased][unreleased]
6
+ ## [Unreleased]
7
7
  - nothing
8
8
 
9
+ ## [0.0.5] - 2015-11-19
10
+ ### Changed
11
+ - added option to specify what metrics to include or exclude,
12
+ either through reading a file or via command argument.
13
+
9
14
  ## [0.0.4] - 2015-08-04
10
15
  ### Changed
11
16
  - general cleanup, no code changes
@@ -15,7 +20,6 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
15
20
  - updated sensu-plugin gem to 1.2.0
16
21
 
17
22
  ## [0.0.2] - 2015-06-03
18
-
19
23
  ### Fixed
20
24
  - added binstubs
21
25
 
@@ -23,6 +27,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
23
27
  - removed cruft from /lib
24
28
 
25
29
  ## 0.0.1 - 2015-05-04
26
-
27
30
  ### Added
28
31
  - initial release
32
+
33
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-riak/compare/0.0.5...HEAD
34
+ [0.0.5]: https://github.com/sensu-plugins/sensu-plugins-riak/compare/0.0.4...0.0.5
35
+ [0.0.4]: https://github.com/sensu-plugins/sensu-plugins-riak/compare/0.0.3...0.0.4
36
+ [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-riak/compare/0.0.2...0.0.3
37
+ [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-riak/compare/0.0.1...0.0.2
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riak/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riak)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riak/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riak)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-riak.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-riak)
8
- [![Codeship Status for sensu-plugins/sensu-plugins-riak](https://codeship.com/projects/a68be280-d4b3-0132-a281-4e043b6b23b5/status?branch=master)](https://codeship.com/projects/77865)
9
8
 
10
9
  ## Functionality
11
10
 
@@ -15,6 +14,43 @@
15
14
 
16
15
  ## Usage
17
16
 
17
+ **metrics-riak**
18
+
19
+ Include only output the specified values, where exclude remove those not wanted.
20
+
21
+ Only one of the four available flags will be used, where the precedence order is, -i,-I,-e,-E.
22
+
23
+ If include or excluded is not manually specified, standard filtering is used.
24
+
25
+ If using a file, metrics are either space separated or newline separated.
26
+
27
+ ```
28
+ {
29
+ "checks": {
30
+ "include_usage": {
31
+ "type": "metric",
32
+ "command": "metrics-riak.rb -i vnode_gets vnode_puts",
33
+ ...
34
+ },
35
+ "include_file_usage": {
36
+ "type": "metric",
37
+ "command": "metrics-riak.rb -I /some/path/include.txt",
38
+ ...
39
+ },
40
+ "exclude_usage": {
41
+ "type": "metric",
42
+ "command": "metrics-riak.rb -e vnode_gets vnode_puts",
43
+ ...
44
+ },
45
+ "exclude_file_usage": {
46
+ "type": "metric",
47
+ "command": "metrics-riak.rb -E /some/path/exclude.txt",
48
+ ...
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
18
54
  ## Installation
19
55
 
20
56
  [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
data/bin/metrics-riak.rb CHANGED
@@ -41,14 +41,45 @@ class RiakMetrics < Sensu::Plugin::Metric::CLI::Graphite
41
41
  long: '--scheme SCHEME',
42
42
  default: "#{Socket.gethostname}.riak"
43
43
 
44
+ option :exclude,
45
+ description: 'List of metrics not to collect',
46
+ short: '-e',
47
+ long: '--exclude',
48
+ boolean: true,
49
+ default: false
50
+
51
+ option :include,
52
+ description: 'List of metrics to only collect',
53
+ short: '-i',
54
+ long: '--include',
55
+ boolean: true,
56
+ default: false
57
+
58
+ option :exclude_file,
59
+ description: 'File with list of metrics not to collect',
60
+ short: '-E FILE',
61
+ long: '--exclude-file FILE',
62
+ default: ''
63
+
64
+ option :include_file,
65
+ description: 'File with list of metrics to only collect',
66
+ short: '-I FILE',
67
+ long: '--include-file FILE',
68
+ default: ''
69
+
70
+ def print_metrics(stats)
71
+ stats.select { |k, _v| stats[k].is_a? Integer }.each do |k, v|
72
+ output "#{config[:scheme]}.#{k}", v
73
+ end
74
+ end
75
+
44
76
  def run
45
77
  res = Net::HTTP.start(config[:hostname], config[:port]) do |http|
46
78
  req = Net::HTTP::Get.new("/#{config[:path]}")
47
79
  http.request(req)
48
80
  end
49
81
 
50
- stats = JSON.parse(res.body)
51
-
82
+ include = []
52
83
  exclude = %w(vnode_index_reads
53
84
  vnode_index_writes
54
85
  vnode_index_writes_postings
@@ -102,7 +133,8 @@ class RiakMetrics < Sensu::Plugin::Metric::CLI::Graphite
102
133
  sys_thread_pool_size
103
134
  sys_wordsize
104
135
  ring_num_partitions
105
- ring_creation_size pbc_connects_total
136
+ ring_creation_size
137
+ pbc_connects_total
106
138
  pbc_connects
107
139
  pbc_active
108
140
  executing_mappers
@@ -136,10 +168,25 @@ class RiakMetrics < Sensu::Plugin::Metric::CLI::Graphite
136
168
  riak_pipe_vnodeq_max
137
169
  riak_pipe_vnodeq_total)
138
170
 
139
- stats.reject { |k, _v| exclude.include?(k) }.select { |k, _v| stats[k].is_a? Integer }.each do |k, v|
140
- output "#{config[:scheme]}.#{k}", v
171
+ if config[:include]
172
+ include = cli_arguments
173
+ elsif config[:include_file] != ''
174
+ include = open(config[:include_file]).read.split
175
+ elsif config[:exclude]
176
+ exclude = cli_arguments
177
+ elsif config[:exclude_file] != ''
178
+ exclude = open(config[:exclude_file]).read.split
141
179
  end
142
180
 
181
+ stats = JSON.parse(res.body)
182
+
183
+ if !include.empty?
184
+ print_metrics(stats.reject { |k, _v| !include.include?(k) })
185
+ elsif !exclude.empty?
186
+ print_metrics(stats.reject { |k, _v| exclude.include?(k) })
187
+ else
188
+ print_metrics(stats)
189
+ end
143
190
  ok
144
191
  end
145
192
  end
@@ -2,7 +2,7 @@ module SensuPluginsRiak
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,186 +1,163 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-riak
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
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRIwEAYDVQQDDAltYXR0
14
- am9uZXMxGDAWBgoJkiaJk/IsZAEZFgh5aWVsZGJvdDETMBEGCgmSJomT8ixkARkW
15
- A2NvbTAeFw0xNTAxMjgyMTAyNTFaFw0xNjAxMjgyMTAyNTFaMEMxEjAQBgNVBAMM
16
- CW1hdHRqb25lczEYMBYGCgmSJomT8ixkARkWCHlpZWxkYm90MRMwEQYKCZImiZPy
17
- LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyTSzVYnO
18
- CLgyrIyT1mBQakArQyW8xhi6MlDqyzXHJGeERT790U6EgoBVeS4XoK0ptFZNR8Tf
19
- zko0w+Nv47TarSCgkPOaxY+mxWnAVR10dOmfeLr7huiMyps+YD56/EF2FqQ3jf/+
20
- qohENfKD91qy1ieEy+Fn7Pf74ltbNKUdkb9a9eFXQ0DQ4ip5vik7DzjQkUTj4lca
21
- k6ArwnmHX4YDhZoYtrQJ8jVktN0/+NtA40M5qkCYHNe5tUW25b/tKVYuioxG6b2Z
22
- oIzaZxRLxf6HVAWpCVRT/F5+/yjigkX4u++eYacfLGleXQzoK7BL65vHGMJygWEE
23
- 0TKGqFOrl/L0AQIDAQABo38wfTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
24
- HQ4EFgQUEf6a8Td7MrSZc8ImbLFZAENPbz0wIQYDVR0RBBowGIEWbWF0dGpvbmVz
25
- QHlpZWxkYm90LmNvbTAhBgNVHRIEGjAYgRZtYXR0am9uZXNAeWllbGRib3QuY29t
26
- MA0GCSqGSIb3DQEBBQUAA4IBAQBbzXAYA3BVGw8DZ0YYoY1VHPNEcH5qPIApmHO8
27
- rvSmuUT0yMEi7u00H/5uHRFf4LleGT/+sTdyXKsNPGT9kdRuQEgwi+vf7Zfvd8aX
28
- UF/+4VkEYf/8rV8Ere6u2QaWPgApdMV6JjKr1fAwCTd8AuGXNaWItiPPMseSQzLJ
29
- JKP4hVvbc1d+oS925B1lcBiqn2aYvElbyNAVmQPywNNqkWmvtlqj9ZVJfV5HQLdu
30
- 8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
- HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
- -----END CERTIFICATE-----
33
- date: 2015-08-05 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2016-03-05 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  name: sensu-plugin
37
15
  requirement: !ruby/object:Gem::Requirement
38
16
  requirements:
39
- - - '='
17
+ - - ~>
40
18
  - !ruby/object:Gem::Version
41
- version: 1.2.0
19
+ version: '1.2'
42
20
  type: :runtime
43
21
  prerelease: false
44
22
  version_requirements: !ruby/object:Gem::Requirement
45
23
  requirements:
46
- - - '='
24
+ - - ~>
47
25
  - !ruby/object:Gem::Version
48
- version: 1.2.0
26
+ version: '1.2'
49
27
  - !ruby/object:Gem::Dependency
50
28
  name: bundler
51
29
  requirement: !ruby/object:Gem::Requirement
52
30
  requirements:
53
- - - "~>"
31
+ - - ~>
54
32
  - !ruby/object:Gem::Version
55
33
  version: '1.7'
56
34
  type: :development
57
35
  prerelease: false
58
36
  version_requirements: !ruby/object:Gem::Requirement
59
37
  requirements:
60
- - - "~>"
38
+ - - ~>
61
39
  - !ruby/object:Gem::Version
62
40
  version: '1.7'
63
41
  - !ruby/object:Gem::Dependency
64
42
  name: codeclimate-test-reporter
65
43
  requirement: !ruby/object:Gem::Requirement
66
44
  requirements:
67
- - - "~>"
45
+ - - ~>
68
46
  - !ruby/object:Gem::Version
69
47
  version: '0.4'
70
48
  type: :development
71
49
  prerelease: false
72
50
  version_requirements: !ruby/object:Gem::Requirement
73
51
  requirements:
74
- - - "~>"
52
+ - - ~>
75
53
  - !ruby/object:Gem::Version
76
54
  version: '0.4'
77
55
  - !ruby/object:Gem::Dependency
78
56
  name: github-markup
79
57
  requirement: !ruby/object:Gem::Requirement
80
58
  requirements:
81
- - - "~>"
59
+ - - ~>
82
60
  - !ruby/object:Gem::Version
83
61
  version: '1.3'
84
62
  type: :development
85
63
  prerelease: false
86
64
  version_requirements: !ruby/object:Gem::Requirement
87
65
  requirements:
88
- - - "~>"
66
+ - - ~>
89
67
  - !ruby/object:Gem::Version
90
68
  version: '1.3'
91
69
  - !ruby/object:Gem::Dependency
92
70
  name: pry
93
71
  requirement: !ruby/object:Gem::Requirement
94
72
  requirements:
95
- - - "~>"
73
+ - - ~>
96
74
  - !ruby/object:Gem::Version
97
75
  version: '0.10'
98
76
  type: :development
99
77
  prerelease: false
100
78
  version_requirements: !ruby/object:Gem::Requirement
101
79
  requirements:
102
- - - "~>"
80
+ - - ~>
103
81
  - !ruby/object:Gem::Version
104
82
  version: '0.10'
105
83
  - !ruby/object:Gem::Dependency
106
84
  name: rake
107
85
  requirement: !ruby/object:Gem::Requirement
108
86
  requirements:
109
- - - "~>"
87
+ - - ~>
110
88
  - !ruby/object:Gem::Version
111
89
  version: '10.0'
112
90
  type: :development
113
91
  prerelease: false
114
92
  version_requirements: !ruby/object:Gem::Requirement
115
93
  requirements:
116
- - - "~>"
94
+ - - ~>
117
95
  - !ruby/object:Gem::Version
118
96
  version: '10.0'
119
97
  - !ruby/object:Gem::Dependency
120
98
  name: redcarpet
121
99
  requirement: !ruby/object:Gem::Requirement
122
100
  requirements:
123
- - - "~>"
101
+ - - ~>
124
102
  - !ruby/object:Gem::Version
125
103
  version: '3.2'
126
104
  type: :development
127
105
  prerelease: false
128
106
  version_requirements: !ruby/object:Gem::Requirement
129
107
  requirements:
130
- - - "~>"
108
+ - - ~>
131
109
  - !ruby/object:Gem::Version
132
110
  version: '3.2'
133
111
  - !ruby/object:Gem::Dependency
134
112
  name: rspec
135
113
  requirement: !ruby/object:Gem::Requirement
136
114
  requirements:
137
- - - "~>"
115
+ - - ~>
138
116
  - !ruby/object:Gem::Version
139
117
  version: '3.1'
140
118
  type: :development
141
119
  prerelease: false
142
120
  version_requirements: !ruby/object:Gem::Requirement
143
121
  requirements:
144
- - - "~>"
122
+ - - ~>
145
123
  - !ruby/object:Gem::Version
146
124
  version: '3.1'
147
125
  - !ruby/object:Gem::Dependency
148
126
  name: rubocop
149
127
  requirement: !ruby/object:Gem::Requirement
150
128
  requirements:
151
- - - '='
129
+ - - ~>
152
130
  - !ruby/object:Gem::Version
153
- version: 0.32.1
131
+ version: '0.37'
154
132
  type: :development
155
133
  prerelease: false
156
134
  version_requirements: !ruby/object:Gem::Requirement
157
135
  requirements:
158
- - - '='
136
+ - - ~>
159
137
  - !ruby/object:Gem::Version
160
- version: 0.32.1
138
+ version: '0.37'
161
139
  - !ruby/object:Gem::Dependency
162
140
  name: yard
163
141
  requirement: !ruby/object:Gem::Requirement
164
142
  requirements:
165
- - - "~>"
143
+ - - ~>
166
144
  - !ruby/object:Gem::Version
167
145
  version: '0.8'
168
146
  type: :development
169
147
  prerelease: false
170
148
  version_requirements: !ruby/object:Gem::Requirement
171
149
  requirements:
172
- - - "~>"
150
+ - - ~>
173
151
  - !ruby/object:Gem::Version
174
152
  version: '0.8'
175
- description: |-
176
- This plugin provides native Riak instrumentation
177
- for monitoring and metrics collection, including:
178
- service health, database connectivity, ring
179
- status, `/stats` metrics, and more.
180
- email: "<sensu-users@googlegroups.com>"
153
+ description: ! "This plugin provides native Riak instrumentation\n for
154
+ monitoring and metrics collection, including:\n service
155
+ health, database connectivity, ring\n status, `/stats`
156
+ metrics, and more."
157
+ email: <sensu-users@googlegroups.com>
181
158
  executables:
182
- - metrics-riak.rb
183
159
  - check-riak-ringready.rb
160
+ - metrics-riak.rb
184
161
  extensions: []
185
162
  extra_rdoc_files: []
186
163
  files:
@@ -207,17 +184,17 @@ require_paths:
207
184
  - lib
208
185
  required_ruby_version: !ruby/object:Gem::Requirement
209
186
  requirements:
210
- - - ">="
187
+ - - ! '>='
211
188
  - !ruby/object:Gem::Version
212
189
  version: 1.9.3
213
190
  required_rubygems_version: !ruby/object:Gem::Requirement
214
191
  requirements:
215
- - - ">="
192
+ - - ! '>='
216
193
  - !ruby/object:Gem::Version
217
194
  version: '0'
218
195
  requirements: []
219
196
  rubyforge_project:
220
- rubygems_version: 2.4.8
197
+ rubygems_version: 2.4.5
221
198
  signing_key:
222
199
  specification_version: 4
223
200
  summary: Sensu plugins for riak
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- j��M di��i
2
- ��<�$O�38�0���r���l(RrYޤ��c�;2��,����<�
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- 8�=��:���"@A*}�E� �UJ�h�aPw(.!V�ڇ
2
- D��T �Ҁ% #m�P�Ep����k�b�@P�^G�1��FoF�� ]�#�r�P��A�0�&=սLͭ��u