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
|
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
|