summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2015-01-20 16:38:51 +0200
committerytti <saku@ytti.fi>2015-01-20 16:38:51 +0200
commit02664aab2ed621f7632beacf35b90614de2f0c59 (patch)
tree17418c9a5a0f82344052b6895dd577543d60fe40
parent7c5d336aa0fbf8dc731eb1d88fb16c3d4b11a162 (diff)
parent5e193e71799fdbe2bc223b6463ed404e4e65f076 (diff)
Merge pull request #70 from yeled/patch-2
stop Aruba changing the diff each 'show inventory'
-rw-r--r--lib/oxidized/model/aosw.rb22
1 files 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