diff options
Diffstat (limited to 'lib/oxidized/model/ironware.rb')
-rw-r--r-- | lib/oxidized/model/ironware.rb | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index f9998ae..2f8df7f 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -1,9 +1,22 @@ class IronWare < Oxidized::Model + prompt /^((\w*)@(.*)([>#])+)$/ comment '! ' + + #to handle pager without enable + #expect /^((.*)--More--(.*))$/ do |data, re| + # send ' ' + # data.sub re, '' + #end + + + #to remove backspace (if handle pager without enable) + #expect /^((.*)[\b](.*))$/ do |data, re| + # data.sub re, '' + #end cmd :all do |cfg| - cfg.each_line.to_a[1..-3].join + cfg.each_line.to_a[1..-2].join end cmd 'show running-config' do |cfg| @@ -12,11 +25,21 @@ class IronWare < Oxidized::Model end cmd 'show version' do |cfg| + cfg.gsub! /(^((.*)system uptime(.*))$)/, '' #remove unwanted line system uptime comment cfg end cmd 'show chassis' do |cfg| cfg.gsub! "\xFF", '' # ugly hack - avoids JSON.dump utf-8 breakage on 1.9.. + cfg.gsub! /(^((.*)Current temp(.*))$)/, '' #remove unwanted lines current temperature + comment cfg + end + + cmd 'show flash' do |cfg| + comment cfg + end + + cmd 'show module' do |cfg| comment cfg end @@ -25,9 +48,16 @@ class IronWare < Oxidized::Model password /^Password:/ end + #handle pager with enable cfg :telnet, :ssh do + if vars :enable + post_login do + send "enable\n" + send vars(:enable) + "\n" + end + end post_login 'skip-page-display' pre_logout 'logout' end -end +end
\ No newline at end of file |