Rubyipmi::Ipmitool::Sensors

Public Class Methods

new(opts = ObservableHash.new) click to toggle source
# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 5
def initialize(opts = ObservableHash.new)
  super("ipmitool", opts)
end

Public Instance Methods

count() click to toggle source
# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 18
def count
  list.count
end
fanlist(refreshdata=false) click to toggle source

returns a hash of fan sensors where the key is fan name and value is the sensor

# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 27
def fanlist(refreshdata=false)
  refresh if refreshdata
  flist = {}
  list.each do | name,sensor |
    if name =~ /.*fan.*/
        flist[name] = sensor
    end
  end
  return flist
end
getsensors() click to toggle source
# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 50
def getsensors
  options["cmdargs"] = "sensor"
  value = runcmd
  options.delete_notify("cmdargs")
  @result
end
list() click to toggle source
# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 14
def list
  @sensors ||= parse(getsensors)
end
names() click to toggle source
# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 22
def names
  list.keys
end
refresh() click to toggle source
# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 9
def refresh
  @sensors = nil
  list
end
templist(refreshdata=false) click to toggle source

returns a hash of sensors where each key is the name of the sensor and the value is the sensor

# File lib/rubyipmi/ipmitool/commands/sensors.rb, line 39
def templist(refreshdata=false)
  refresh if refreshdata
  tlist = {}
  list.each do | name , sensor |
    if sensor[:unit] =~ /.*degree.*/ || name =~ /.*temp.*/
      tlist[name] = sensor
    end
  end
  return tlist
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.