From c396eafd3dcd7f2853665a9b6771e346a8b24eac Mon Sep 17 00:00:00 2001 From: broxio Date: Fri, 13 May 2016 16:40:41 +0800 Subject: Update acos.rb Modified pre_logout and change \n to \r --- lib/oxidized/model/acos.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/oxidized/model/acos.rb') diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb index 75fbacf..ec3ef11 100644 --- a/lib/oxidized/model/acos.rb +++ b/lib/oxidized/model/acos.rb @@ -1,5 +1,5 @@ class ACOS < Oxidized::Model - # A10 ACOS model for AX and Thunder series + # A10 ACOS model for AX and Thunder series comment '! ' @@ -16,11 +16,15 @@ class ACOS < Oxidized::Model cmd 'show running-config all-partitions' + cmd 'show aflex all-partitions' do |cfg| + comment cfg + end + cmd 'show aflex all-partitions' do |cfg| @partitions_aflex = cfg.lines.each_with_object({}) do |l,h| h[$1] = [] if l.match /partition: (.+)/ # only consider scripts that have passed syntax check - h[h.keys.last] << $1 if l.match /^([\w-]+) +Check/ + h[h.keys.last] << $1 if l.match /^([\w-]+) +Check/ end '' end @@ -52,18 +56,20 @@ class ACOS < Oxidized::Model username /login:/ password /^Password:/ end - + cfg :telnet, :ssh do # preferred way to handle additional passwords if vars :enable post_login do - send "enable\n" - send vars(:enable) + "\n" + send "enable\r" + send vars(:enable) + "\r" end end post_login 'terminal length 0' post_login 'terminal width 0' - pre_logout "exit\nexit\ny" + post_login 'terminal idle-timeout 10' + post_login "en\n" + pre_logout "exit\nexit\nY\r\n" end end -- cgit v1.2.1