From 5e193e71799fdbe2bc223b6463ed404e4e65f076 Mon Sep 17 00:00:00 2001 From: Charlie Allom Date: Tue, 20 Jan 2015 12:41:24 +0000 Subject: stop Aruba changing the diff each 'show inventory' Also fix the boilerplate comment to reflect the OEM relationship --- lib/oxidized/model/aosw.rb | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 26ee0fa..203c5e0 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -1,7 +1,8 @@ class AOSW < Oxidized::Model - # AOSW - Alcatel-Lucent OS - Wireless - # Used in Alcatel OAW-4750 WLAN controller (Aruba) + # AOSW Aruba Wireless + # Used in Alcatel OAW-4750 WLAN controller + # Also Dell controllers comment '# ' prompt /^\([^)]+\) #/ @@ -16,8 +17,7 @@ class AOSW < Oxidized::Model end cmd 'show inventory' do |cfg| - cfg = cfg.each_line.take_while { |line| not line.match /Output \d Config/i } - comment cfg.join + clean cfg end cmd 'show slots' do |cfg| @@ -40,4 +40,18 @@ class AOSW < Oxidized::Model pre_logout 'exit' end + def clean cfg + out = [] + cfg.each_line do |line| + # drop the temperature, fan speed and voltage, which change each run + 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|mV|C)$/ + out << line.strip + end + out = out.join "\n" + out << "\n" + end + end -- cgit v1.2.1