riemann-babbler 0.9.6 → 0.9.7

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.
data/config.yml CHANGED
@@ -60,3 +60,6 @@ plugins:
60
60
 
61
61
  nginx:
62
62
  service: nginx
63
+
64
+ runit:
65
+ service: runit
@@ -3,11 +3,12 @@ class Riemann::Babbler::Runit < Riemann::Babbler
3
3
  def init
4
4
  plugin.set_default(:service, 'runit')
5
5
  plugin.set_default(:not_monit, [])
6
- plugin.set_default(:interval, 60)
6
+ plugin.set_default(:interval, 10)
7
7
  end
8
8
 
9
9
  def run_plugin
10
10
  Dir.exists? '/etc/service'
11
+ @status_history = Array.new
11
12
  end
12
13
 
13
14
  def read_run_status
@@ -15,8 +16,12 @@ class Riemann::Babbler::Runit < Riemann::Babbler
15
16
  Dir.glob('/etc/service/*').each do |srv|
16
17
  next if plugin.not_monit.include? srv
17
18
  human_srv = ' ' + srv.gsub(/\/etc\/service\//,"")
18
- unless File.read( File.join(srv, 'supervise', 'stat') ).strip == 'run'
19
- status << {:service => plugin.service + human_srv , :state => 'critical', :description => "runit service #{human_srv} not running"}
19
+ if File.read( File.join(srv, 'supervise', 'stat') ).strip == 'run'
20
+ @status_history.delete "human_srv"
21
+ status << {:service => plugin.service + human_srv , :state => 'ok', :description => "runit service #{human_srv} running"}
22
+ else
23
+ status << {:service => plugin.service + human_srv , :state => 'critical', :description => "runit service #{human_srv} not running"} if @status_history.include? human_srv
24
+ @status_history << human_srv unless @status_history.include? human_srv
20
25
  end
21
26
  end
22
27
  status
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '0.9.6'
3
+ VERSION = '0.9.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-babbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: -4598339307105948207
193
+ hash: 1337242013675877660
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  none: false
196
196
  requirements: