From f4483bfd63be3d74f42e027cfbb2a8929ebc9ac1 Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Thu, 28 Jan 2016 00:00:42 +0000 Subject: Strip more temperature and voltage output from different models --- lib/oxidized/model/aosw.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 81d3243..5135115 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -56,7 +56,7 @@ class AOSW < Oxidized::Model next if line.match /Output \d Config/i next if line.match /(Tachometers|Temperatures|Voltages)/ next if line.match /((Card|CPU) Temperature|Chassis Fan|VMON1[0-9])/ - next if line.match /[0-9]+ (RPM|RPMs|mV|C)$/ + next if line.match /[0-9]+ (RPMS?|m?V|C)/i out << line.strip end out = comment out.join "\n" -- cgit v1.2.1 From 135a9123b493ea896b0719395fd1bbfdc628ffe2 Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Thu, 28 Jan 2016 00:01:21 +0000 Subject: Enable secret handling for AOSW --- lib/oxidized/model/aosw.rb | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 5135115..4f09e51 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -11,6 +11,20 @@ class AOSW < Oxidized::Model cfg.each_line.to_a[1..-2].join end + cmd :secret do |cfg| + 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!(/key (\S+)$/, 'key ') + cfg.gsub!(/secret (\S+)$/, 'secret ') + cfg.gsub!(/wpa-passphrase (\S+)$/, 'wpa-passphrase ') + cfg + end + cmd 'show version' do |cfg| cfg = cfg.each_line.select { |line| not line.match /Switch uptime/i } comment cfg.join @@ -26,8 +40,15 @@ class AOSW < Oxidized::Model cmd 'show license' do |cfg| comment cfg end - cmd 'show configuration' do |cfg| - cfg + cmd 'show running-config' do |cfg| + out = [] + cfg.each_line do |line| + next if line.match /^controller config \d+$/ + next if line.match /^Building Configuration/ + out << line.strip + end + out = out.join "\n" + out << "\n" end cfg :telnet do @@ -43,6 +64,7 @@ class AOSW < Oxidized::Model end end post_login 'no paging' + post_login 'encrypt disable' if vars :enable pre_logout 'exit' end -- cgit v1.2.1