lib/oxidized/model/ironware.rb in oxidized-0.19.0 vs lib/oxidized/model/ironware.rb in oxidized-0.20.0

- old
+ new

@@ -28,14 +28,15 @@ comment cfg 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}\%\)/, '' + cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, '' cfg.gsub! /\d{2}\.\d deg-C/, 'XX.X deg-C' if cfg.include? "TEMPERATURE" sc = StringScanner.new cfg out = '' temps = '' @@ -64,25 +65,23 @@ cfg :telnet do # match expected prompts on both older and newer # versions of IronWare username /^(Please Enter Login Name|Username):/ - password /^(Please Enter )Password:/ + password /^(Please Enter Password |Password):/ end #handle pager with enable cfg :telnet, :ssh do if vars :enable post_login do - send "enable\r\n" + send "enable\n" cmd vars(:enable) end end post_login '' post_login 'skip-page-display' post_login 'terminal length 0' - pre_logout 'logout' - pre_logout 'exit' - pre_logout 'exit' + pre_logout "logout\nexit\nexit\n" end end