Class: AOSW

Inherits:
Oxidized::Model show all
Defined in:
lib/oxidized/model/aosw.rb

Instance Attribute Summary

Attributes inherited from Oxidized::Model

#input, #node

Instance Method Summary collapse

Methods inherited from Oxidized::Model

cfg, #cfg, cfgs, #cmd, cmd, cmds, comment, #comment, expect, #expect, expects, #expects, #get, inherited, #output, post, pre, procs, prompt, #prompt, #screenscrape, #send

Methods included from Oxidized::Config::Vars

#vars

Instance Method Details

#clean(cfg) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/oxidized/model/aosw.rb', line 102

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]+\s+(RPMS?|m?V|C)/i
    out << line.strip
  end
  out = comment out.join "\n"
  out << "\n"
end

#rstrip_cfg(cfg) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/oxidized/model/aosw.rb', line 93

def rstrip_cfg cfg
  out = []
  cfg.each_line do |line|
    out << line.rstrip
  end
  out = out.join "\n"
  out << "\n"
end