diff options
Diffstat (limited to 'lib/oxidized/model/ironware.rb')
-rw-r--r-- | lib/oxidized/model/ironware.rb | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 386d585..32dbf47 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -1,19 +1,17 @@ class IronWare < Oxidized::Model - prompt /^.*(telnet|ssh)\@.+[>#]\s?$/i comment '! ' - #to handle pager without enable - #expect /^((.*)--More--(.*))$/ do |data, re| + # to handle pager without enable + # expect /^((.*)--More--(.*))$/ do |data, re| # send ' ' # data.sub re, '' - #end - + # end - #to remove backspace (if handle pager without enable) - #expect /^((.*)[\b](.*))$/ do |data, re| + # to remove backspace (if handle pager without enable) + # expect /^((.*)[\b](.*))$/ do |data, re| # data.sub re, '' - #end + # end cmd :all do |cfg| # sometimes ironware inserts arbitrary whitespace after commands are @@ -22,17 +20,17 @@ class IronWare < Oxidized::Model end cmd 'show version' do |cfg| - cfg.gsub! /(^((.*)[Ss]ystem uptime(.*))$)/, '' #remove unwanted line system uptime + cfg.gsub! /(^((.*)[Ss]ystem uptime(.*))$)/, '' # remove unwanted line system uptime cfg.gsub! /(^((.*)[Tt]he system started at(.*))$)/, '' - cfg.gsub! /[Uu]p\s?[Tt]ime is .*/,'' + cfg.gsub! /[Uu]p\s?[Tt]ime is .*/, '' comment cfg end cmd 'show chassis' do |cfg| - 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.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! /Fan \d* - STATUS: OK \D*\d*./, '' # Fix for ADX Fan speed reporting cfg.gsub! /\d* deg C/, '' # Fix for ADX temperature reporting @@ -73,7 +71,7 @@ class IronWare < Oxidized::Model password /^(Please Enter Password ?|Password):/ end - #handle pager with enable + # handle pager with enable cfg :telnet, :ssh do if vars :enable post_login do @@ -86,5 +84,4 @@ class IronWare < Oxidized::Model post_login 'terminal length 0' pre_logout "logout\nexit\nexit\n" end - end |