riemann-tools 1.11.0 → 2.0.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +3 -3
  3. data/.github/workflows/codeql-analysis.yml +4 -4
  4. data/.rubocop.yml +1 -1
  5. data/CHANGELOG.md +65 -10
  6. data/Gemfile +1 -11
  7. data/README.markdown +4 -3
  8. data/lib/riemann/tools/apache_status.rb +1 -0
  9. data/lib/riemann/tools/bench.rb +6 -5
  10. data/lib/riemann/tools/cloudant.rb +1 -0
  11. data/lib/riemann/tools/haproxy.rb +1 -0
  12. data/lib/riemann/tools/health.rb +7 -5
  13. data/lib/riemann/tools/hwmon.rb +24 -7
  14. data/lib/riemann/tools/mdstat_parser.tab.rb +137 -127
  15. data/lib/riemann/tools/memcached.rb +1 -0
  16. data/lib/riemann/tools/nginx_status.rb +1 -0
  17. data/lib/riemann/tools/portcheck.rb +1 -0
  18. data/lib/riemann/tools/riemann_client_wrapper.rb +49 -6
  19. data/lib/riemann/tools/tls_check.rb +4 -2
  20. data/lib/riemann/tools/uptime_parser.tab.rb +1 -1
  21. data/lib/riemann/tools/version.rb +1 -1
  22. data/lib/riemann/tools/zookeeper.rb +1 -0
  23. data/lib/riemann/tools.rb +4 -1
  24. data/riemann-tools.gemspec +5 -4
  25. data/tools/riemann-aws/lib/riemann/tools/aws/billing.rb +1 -0
  26. data/tools/riemann-aws/lib/riemann/tools/aws/elb_metrics.rb +1 -0
  27. data/tools/riemann-aws/lib/riemann/tools/aws/rds_status.rb +1 -0
  28. data/tools/riemann-aws/lib/riemann/tools/aws/s3_list.rb +1 -0
  29. data/tools/riemann-aws/lib/riemann/tools/aws/s3_status.rb +1 -0
  30. data/tools/riemann-aws/lib/riemann/tools/aws/sqs_status.rb +1 -0
  31. data/tools/riemann-aws/lib/riemann/tools/aws/status.rb +1 -0
  32. data/tools/riemann-chronos/lib/riemann/tools/chronos.rb +4 -4
  33. data/tools/riemann-elasticsearch/lib/riemann/tools/elasticsearch.rb +3 -2
  34. data/tools/riemann-marathon/lib/riemann/tools/marathon.rb +4 -4
  35. data/tools/riemann-mesos/lib/riemann/tools/mesos.rb +4 -4
  36. data/tools/riemann-munin/lib/riemann/tools/munin.rb +1 -0
  37. data/tools/riemann-rabbitmq/lib/riemann/tools/rabbitmq.rb +3 -3
  38. data/tools/riemann-riak/lib/riemann/tools/riak.rb +3 -2
  39. metadata +18 -4
@@ -6,6 +6,7 @@ module Riemann
6
6
  module Tools
7
7
  class Elasticsearch
8
8
  include Riemann::Tools
9
+
9
10
  require 'faraday'
10
11
  require 'json'
11
12
  require 'uri'
@@ -42,8 +43,8 @@ module Riemann
42
43
  def make_es_url(path)
43
44
  path_prefix = options[:path_prefix]
44
45
  path_prefix[0] = '' if path_prefix[0] == '/'
45
- path_prefix[path_prefix.length - 1] = '' if path_prefix[path_prefix.length - 1] == '/'
46
- "http://#{options[:es_host]}:#{options[:es_port]}#{path_prefix.length.positive? ? '/' : ''}#{path_prefix}/#{path}"
46
+ path_prefix[-1] = '' if path_prefix[-1] == '/'
47
+ "http://#{options[:es_host]}:#{options[:es_port]}#{'/' if path_prefix.length.positive?}#{path_prefix}/#{path}"
47
48
  end
48
49
 
49
50
  def health_url
@@ -49,15 +49,15 @@ module Riemann
49
49
  def health_url
50
50
  path_prefix = options[:path_prefix]
51
51
  path_prefix[0] = '' if path_prefix[0] == '/'
52
- path_prefix[path_prefix.length - 1] = '' if path_prefix[path_prefix.length - 1] == '/'
53
- "http://#{options[:marathon_host]}:#{options[:marathon_port]}#{path_prefix.length.positive? ? '/' : ''}#{path_prefix}/metrics"
52
+ path_prefix[-1] = '' if path_prefix[-1] == '/'
53
+ "http://#{options[:marathon_host]}:#{options[:marathon_port]}#{'/' if path_prefix.length.positive?}#{path_prefix}/metrics"
54
54
  end
55
55
 
56
56
  def apps_url
57
57
  path_prefix = options[:path_prefix]
58
58
  path_prefix[0] = '' if path_prefix[0] == '/'
59
- path_prefix[path_prefix.length - 1] = '' if path_prefix[path_prefix.length - 1] == '/'
60
- "http://#{options[:marathon_host]}:#{options[:marathon_port]}#{path_prefix.length.positive? ? '/' : ''}#{path_prefix}/v2/apps"
59
+ path_prefix[-1] = '' if path_prefix[-1] == '/'
60
+ "http://#{options[:marathon_host]}:#{options[:marathon_port]}#{'/' if path_prefix.length.positive?}#{path_prefix}/v2/apps"
61
61
  end
62
62
 
63
63
  def tick
@@ -42,15 +42,15 @@ module Riemann
42
42
  def health_url
43
43
  path_prefix = options[:path_prefix]
44
44
  path_prefix[0] = '' if path_prefix[0] == '/'
45
- path_prefix[path_prefix.length - 1] = '' if path_prefix[path_prefix.length - 1] == '/'
46
- "http://#{options[:mesos_host]}:#{options[:mesos_port]}#{path_prefix.length.positive? ? '/' : ''}#{path_prefix}/metrics/snapshot"
45
+ path_prefix[-1] = '' if path_prefix[-1] == '/'
46
+ "http://#{options[:mesos_host]}:#{options[:mesos_port]}#{'/' if path_prefix.length.positive?}#{path_prefix}/metrics/snapshot"
47
47
  end
48
48
 
49
49
  def slaves_url
50
50
  path_prefix = options[:path_prefix]
51
51
  path_prefix[0] = '' if path_prefix[0] == '/'
52
- path_prefix[path_prefix.length - 1] = '' if path_prefix[path_prefix.length - 1] == '/'
53
- "http://#{options[:mesos_host]}:#{options[:mesos_port]}#{path_prefix.length.positive? ? '/' : ''}#{path_prefix}/master/slaves"
52
+ path_prefix[-1] = '' if path_prefix[-1] == '/'
53
+ "http://#{options[:mesos_host]}:#{options[:mesos_port]}#{'/' if path_prefix.length.positive?}#{path_prefix}/master/slaves"
54
54
  end
55
55
 
56
56
  def tick
@@ -7,6 +7,7 @@ module Riemann
7
7
  module Tools
8
8
  class Munin
9
9
  include Riemann::Tools
10
+
10
11
  require 'munin-ruby'
11
12
 
12
13
  def initialize
@@ -100,9 +100,9 @@ module Riemann
100
100
  svc = "rabbitmq.queue.#{queue['vhost']}.#{queue['name']}"
101
101
  errs = []
102
102
 
103
- errs << 'Queue has jobs but no consumers' if !queue['messages_ready'].nil? && (queue['messages_ready']).positive? && (queue['consumers']).zero?
103
+ errs << 'Queue has jobs but no consumers' if !queue['messages_ready'].nil? && queue['messages_ready'].positive? && queue['consumers'].zero?
104
104
 
105
- errs << "Queue has #{queue['messages_ready']} jobs" if (max_size_check_filter.nil? || queue['name'] !~ (max_size_check_filter)) && !queue['messages_ready'].nil? && (queue['messages_ready'] > opts[:max_queue_size])
105
+ errs << "Queue has #{queue['messages_ready']} jobs" if (max_size_check_filter.nil? || queue['name'] !~ max_size_check_filter) && !queue['messages_ready'].nil? && (queue['messages_ready'] > opts[:max_queue_size])
106
106
 
107
107
  if errs.empty?
108
108
  report(
@@ -133,7 +133,7 @@ module Riemann
133
133
 
134
134
  stats.each_pair do |k, v|
135
135
  service = "#{svc}.#{k}"
136
- metric = if k =~ (/details$/) && !v.nil?
136
+ metric = if k =~ /details$/ && !v.nil?
137
137
  v['rate']
138
138
  else
139
139
  v
@@ -9,6 +9,7 @@ module Riemann
9
9
  module Tools
10
10
  class Riak
11
11
  include Riemann::Tools
12
+
12
13
  require 'net/http'
13
14
  require 'net/https'
14
15
  require 'yajl/json_gem'
@@ -157,7 +158,7 @@ module Riemann
157
158
  case val
158
159
  when 0..limit
159
160
  'ok'
160
- when limit..limit * 2
161
+ when limit..(limit * 2)
161
162
  'warning'
162
163
  else
163
164
  'critical'
@@ -289,7 +290,7 @@ module Riemann
289
290
  fsm_types.each do |typespec|
290
291
  typespec.each do |type, prop|
291
292
  fsm_percentiles.each do |percentile|
292
- val = stats[fsm_stat(type, prop, percentile)].to_i || 0
293
+ val = stats[fsm_stat(type, prop, percentile)].to_i
293
294
  val = 0 if val == 'undefined'
294
295
  val /= 1000.0 if prop == 'time' # Convert us to ms
295
296
  state = if prop == 'time'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-07 00:00:00.000000000 Z
11
+ date: 2026-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: csv
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: json
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -241,14 +255,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
241
255
  requirements:
242
256
  - - ">="
243
257
  - !ruby/object:Gem::Version
244
- version: 2.6.0
258
+ version: 2.7.0
245
259
  required_rubygems_version: !ruby/object:Gem::Requirement
246
260
  requirements:
247
261
  - - ">="
248
262
  - !ruby/object:Gem::Version
249
263
  version: '0'
250
264
  requirements: []
251
- rubygems_version: 3.5.13
265
+ rubygems_version: 3.3.3
252
266
  signing_key:
253
267
  specification_version: 4
254
268
  summary: Utilities which submit events to Riemann.