lib/oxidized/model/aosw.rb in oxidized-0.2.3 vs lib/oxidized/model/aosw.rb in oxidized-0.2.4
- old
+ new
@@ -1,9 +1,10 @@
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 /^\([^)]+\) #/
cmd :all do |cfg|
@@ -14,12 +15,11 @@
cfg = cfg.each_line.select { |line| not line.match /Switch uptime/i }
comment cfg.join
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|
comment cfg
end
@@ -36,8 +36,22 @@
end
cfg :telnet, :ssh do
post_login 'no paging'
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