riemann-babbler 1.2.8 → 1.2.9

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.
@@ -10,6 +10,11 @@ class Riemann::Babbler::Mdadm < Riemann::Babbler
10
10
  File.exists? '/proc/mdstat'
11
11
  end
12
12
 
13
+ def mdadm_status_well?(text)
14
+ text = text.gsub('[','').gsub(']','')
15
+ text.gsub(/U/,'').empty?
16
+ end
17
+
13
18
  def collect
14
19
  file = File.read('/proc/mdstat').split("\n")
15
20
  status = Array.new
@@ -19,7 +24,7 @@ class Riemann::Babbler::Mdadm < Riemann::Babbler
19
24
  device = file[index-1].split(':')[0].strip
20
25
 
21
26
  mdstatus = line.split(" ").last
22
- next if mdstatus == '[UU]' # пропускаем все збс
27
+ next if mdadm_status_well?(mdstatus) # пропускаем все збс
23
28
  if mdstatus == plugin.states.send(device).to_s # пропускаем если стейт зафикисирован в конфиге
24
29
  status << { :service => plugin.service + " #{device}", :metric => 1, :state => 'ok', :description => "mdadm failed device #{device}, but disabled in config" }
25
30
  next
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '1.2.8'
3
+ VERSION = '1.2.9'
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: 1.2.8
4
+ version: 1.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: