From 853a1dd57776955c20377f6f13a5a71e892d89f0 Mon Sep 17 00:00:00 2001 From: devicenull Date: Mon, 9 Jan 2017 16:32:48 -0500 Subject: Ignore undefined UTF8 in ironware.rb We have some Brocade MLX devices that are triggering 'raised Encoding::UndefinedConversionError with msg ""\xFF" from ASCII-8BIT to UTF-8"'. Update the ironware.rb file to ignore undefined UTF8 as well as invalid UTF8 --- lib/oxidized/model/ironware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index db341d1..ade8b44 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -30,7 +30,7 @@ class IronWare < Oxidized::Model end cmd 'show chassis' do |cfg| - cfg.encode!("UTF-8", :invalid => :replace) #sometimes ironware returns broken encoding + cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) #sometimes ironware returns broken encoding 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}\%\)/, '' -- cgit v1.2.1