Method: AOSW#clean

Defined in:
lib/oxidized/model/aosw.rb

#clean(cfg) ⇒ Object



118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oxidized/model/aosw.rb', line 118

def clean(cfg)
  out = []
  cfg.each_line do |line|
    # drop the temperature, fan speed and voltage, which change each run
    next if line =~ /Output \d Config/i
    next if line =~ /(Tachometers|Temperatures|Voltages)/
    next if line =~ /((Card|CPU) Temperature|Chassis Fan|VMON1[0-9])/
    next if line =~ /[0-9.]{1,6}\s+(RPMS?|m?V|C|W)/i

    out << line.strip
  end
  out = comment out.join "\n"
  out << "\n"
end