Rubyipmi::Freeipmi::Sensors

Public Class Methods

new(opts = ObservableHash.new) click to toggle source
# File lib/rubyipmi/freeipmi/commands/sensors.rb, line 5
def initialize(opts = ObservableHash.new)
  super("ipmi-sensors", opts)
  @options["no-header-output"] = false
  @options["output-sensor-state"] = false
  @options["entity-sensor-names"] = false
end

Public Instance Methods

count() click to toggle source
# File lib/rubyipmi/freeipmi/commands/sensors.rb, line 21
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/freeipmi/commands/sensors.rb, line 30
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/freeipmi/commands/sensors.rb, line 53
def getsensors
  value = runcmd
  return @result
end
list() click to toggle source
# File lib/rubyipmi/freeipmi/commands/sensors.rb, line 17
def list
  @sensors ||= parse(getsensors)
end
names() click to toggle source
# File lib/rubyipmi/freeipmi/commands/sensors.rb, line 25
def names
  list.keys
end
refresh() click to toggle source
# File lib/rubyipmi/freeipmi/commands/sensors.rb, line 12
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/freeipmi/commands/sensors.rb, line 42
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.