From 4e6fc650d326e146558627fd6f13ac301fe24450 Mon Sep 17 00:00:00 2001 From: Tim Pray Date: Tue, 7 Feb 2017 09:41:55 -0500 Subject: Modify to support IAP, Instant Controller and Mobility Access Switches --- lib/oxidized/model/aosw.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index adf481b..1719dfb 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -5,43 +5,50 @@ class AOSW < Oxidized::Model # Also Dell controllers comment '# ' - prompt /^\([^)]+\) [#>]/ + prompt /^\(?.+\)?\s?[#>]/ cmd :all do |cfg| cfg.each_line.to_a[1..-2].join end cmd :secret do |cfg| + cfg.gsub!(/enable secret (\S+)$/, 'enable secret ') cfg.gsub!(/PRE-SHARE (\S+)$/, 'PRE-SHARE ') cfg.gsub!(/ipsec (\S+)$/, 'ipsec ') cfg.gsub!(/community (\S+)$/, 'community ') cfg.gsub!(/ sha (\S+)/, ' sha ') cfg.gsub!(/ des (\S+)/, ' des ') cfg.gsub!(/mobility-manager (\S+) user (\S+) (\S+)/, 'mobility-manager \1 user \2 ') - cfg.gsub!(/mgmt-user (\S+) (\S+) (\S+)$/, 'mgmt-user \1 \2 ') + cfg.gsub!(/mgmt-user (\S+) (root|guest\-provisioning|network\-operations|read\-only|location\-api\-mgmt) (\S+)$/, 'mgmt-user \1 \2 ') #MAS & Wireless Controler + cfg.gsub!(/mgmt-user (\S+) (\S+)( (read\-only|guest\-mgmt))?$/, 'mgmt-user \1 \3') #IAP +#MAS format: mgmt-user +#IAP format: mgmt-user +#IAP format: mgmt-user cfg.gsub!(/key (\S+)$/, 'key ') - cfg.gsub!(/secret (\S+)$/, 'secret ') cfg.gsub!(/wpa-passphrase (\S+)$/, 'wpa-passphrase ') cfg.gsub!(/bkup-passwords (\S+)$/, 'bkup-passwords ') + cfg.gsub!(/user (\S+) (\S+) (\S+)$/, 'user \1 \3') + cfg.gsub!(/virtual-controller-key (\S+)$/, 'virtual-controller-key ') cfg end cmd 'show version' do |cfg| - cfg = cfg.each_line.select { |line| not line.match /Switch uptime/i } + cfg = cfg.each_line.select { |line| not line.match /(Switch|AP) uptime/i } rstrip_cfg comment cfg.join end cmd 'show inventory' do |cfg| + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices rstrip_cfg clean cfg end cmd 'show slots' do |cfg| - cfg = "" if cfg.match /Invalid input detected at '\^' marker/ #Don't show for unsupported devices + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices rstrip_cfg comment cfg end cmd 'show license' do |cfg| - cfg = "" if cfg.match /Invalid input detected at '\^' marker/ #Don't show for unsupported devices + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices rstrip_cfg comment cfg end -- cgit v1.2.1 From a1e6277280b1882757f369cb57358c5cbc6aa170 Mon Sep 17 00:00:00 2001 From: Tim Pray Date: Tue, 7 Feb 2017 12:22:35 -0500 Subject: Better notes and fix a mistake in the secret lines --- lib/oxidized/model/aosw.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 1719dfb..a85ead7 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -1,8 +1,14 @@ class AOSW < Oxidized::Model - # AOSW Aruba Wireless + # AOSW Aruba Wireless, IAP, Instant Controller and Mobility Access Switches # Used in Alcatel OAW-4750 WLAN controller # Also Dell controllers + + # HPE Aruba Switches should use a different model as the software is based on the HP Procurve line. + + # Support for IAP & Instant Controller tested with 115, 205, 215 & 325 running 6.4.4.8-4.2.4.5_57965 + # Support for Mobility Access Switches tested with S2500-48P & S2500-24P running 7.4.1.4_54199 and S2500-24P running 7.4.1.7_57823 + # All IAPs connected to a Instant Controller will have the same config output. Only the controller needs to be monitored. comment '# ' prompt /^\(?.+\)?\s?[#>]/ @@ -12,6 +18,7 @@ class AOSW < Oxidized::Model end cmd :secret do |cfg| + cfg.gsub!(/secret (\S+)$/, 'secret ') cfg.gsub!(/enable secret (\S+)$/, 'enable secret ') cfg.gsub!(/PRE-SHARE (\S+)$/, 'PRE-SHARE ') cfg.gsub!(/ipsec (\S+)$/, 'ipsec ') @@ -21,8 +28,8 @@ class AOSW < Oxidized::Model cfg.gsub!(/mobility-manager (\S+) user (\S+) (\S+)/, 'mobility-manager \1 user \2 ') cfg.gsub!(/mgmt-user (\S+) (root|guest\-provisioning|network\-operations|read\-only|location\-api\-mgmt) (\S+)$/, 'mgmt-user \1 \2 ') #MAS & Wireless Controler cfg.gsub!(/mgmt-user (\S+) (\S+)( (read\-only|guest\-mgmt))?$/, 'mgmt-user \1 \3') #IAP -#MAS format: mgmt-user -#IAP format: mgmt-user +#MAS format: mgmt-user +#IAP format (root user): mgmt-user #IAP format: mgmt-user cfg.gsub!(/key (\S+)$/, 'key ') cfg.gsub!(/wpa-passphrase (\S+)$/, 'wpa-passphrase ') @@ -38,17 +45,17 @@ class AOSW < Oxidized::Model end cmd 'show inventory' do |cfg| - cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices (IAP and MAS) rstrip_cfg clean cfg end cmd 'show slots' do |cfg| - cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices (IAP and MAS) rstrip_cfg comment cfg end cmd 'show license' do |cfg| - cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices (IAP and MAS) rstrip_cfg comment cfg end -- cgit v1.2.1