Class: AOSW

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

Constant Summary

Constants inherited from Oxidized::Model

Oxidized::Model::METADATA_DEFAULT

Instance Attribute Summary

Attributes inherited from Oxidized::Model

#input, #node

Instance Method Summary collapse

Methods inherited from Oxidized::Model

cfg, #cfg, cfgs, clean, cmd, #cmd, cmds, comment, #comment, #expect, expect, expects, #expects, #get, inherited, #interpolate_string, metadata, #metadata, #output, post, pre, prompt, #prompt, #screenscrape, #send, #xmlcomment

Methods included from Oxidized::Config::Vars

#vars

Instance Method Details

#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

#rstrip_cfg(cfg) ⇒ Object



109
110
111
112
113
114
115
116
# File 'lib/oxidized/model/aosw.rb', line 109

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