From 34725454fe631bdd3ca790bb7ce0c71fa679f3ff Mon Sep 17 00:00:00 2001 From: devicenull Date: Wed, 18 Jan 2017 17:17:09 -0500 Subject: Update ironware.rb Some Brocade devices only have two possible fan speeds. Previously, this only handled three levels of fan speeds. Updated regex will handle both of these cases: Fan 1 ok, speed (auto): 1<->[[2]] Fan 1 ok, speed (auto): 1<->[[2]]<->3 --- lib/oxidized/model/ironware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index e1c6da1..5b58f22 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -34,7 +34,7 @@ class IronWare < Oxidized::Model cfg.gsub! /(^((.*)Current temp(.*))$)/, '' #remove unwanted lines current temperature cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}\%\)/, '' #remove unwanted lines Speed Fans cfg.gsub! /current speed is [A-Z]{2,6} \(\d{2,3}\%\)/, '' - cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)<->([\[]*)3([\]]*)/, '' + cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, '' cfg.gsub! /\d{2}\.\d deg-C/, 'XX.X deg-C' if cfg.include? "TEMPERATURE" sc = StringScanner.new cfg -- cgit v1.2.1