summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/ironware.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/ironware.rb')
-rw-r--r--lib/oxidized/model/ironware.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb
index db341d1..c7c2197 100644
--- a/lib/oxidized/model/ironware.rb
+++ b/lib/oxidized/model/ironware.rb
@@ -30,10 +30,11 @@ 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}\%\)/, ''
+ cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, ''
cfg.gsub! /\d{2}\.\d deg-C/, 'XX.X deg-C'
if cfg.include? "TEMPERATURE"
sc = StringScanner.new cfg
@@ -73,16 +74,14 @@ class IronWare < Oxidized::Model
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