Closed ushacow closed 6 years ago
Same here... something like:
return unless !mg.empty?
Glad this is not just me agreed makes more sense that it should return if the mg is empty. But same I'm no ruby expert.
I can confirm that software raid checks currently don't work. Downgrading to sensu-plugins-raid-checks
2.0.0 fixes the issue. It seems like commit d7f53f6828127791ae2e215a1f316f1bd66766c0 is to blame, it inverted the check for mg.empty?
. The following patch should fix that:
--- check-raid.rb.old 2018-04-03 15:33:36.588418165 +0200
+++ check-raid.rb.new 2018-04-03 15:33:44.308418606 +0200
@@ -44,7 +44,7 @@
return unless File.exist?('/proc/mdstat')
contents = File.read('/proc/mdstat')
mg = contents.lines.grep(/active|blocks/)
- return unless mg.empty?
+ return if mg.empty?
sg = mg.to_s.lines.grep(/\]\(F\)|[\[U]_/)
if sg.empty?
ok 'Software RAID OK'
released: https://rubygems.org/gems/sensu-plugins-raid-checks/versions/2.0.2
closed via #20
Hi! I suppose there is a mistake in software raid check. I have software raid, but check-raid.rb ignores it and print "CheckRaid OK: No RAID present". Here is /proc/mdstat:
I think mistake is in return unless mg.empty? (it should be return if mg.empty?) Sorry for this issue, I may be wrong, I don't have an experience with Ruby