class Rubyipmi::Freeipmi::BmcDevice

Public Class Methods

new(opts = ObservableHash.new) click to toggle source
Calls superclass method Rubyipmi::BaseCommand.new
# File lib/rubyipmi/freeipmi/commands/bmcdevice.rb, line 5
def initialize(opts = ObservableHash.new)
  super("bmc-device", opts)
end

Public Instance Methods

command(opt) click to toggle source

runs a command like bmc-device –cold-reset

# File lib/rubyipmi/freeipmi/commands/bmcdevice.rb, line 10
def command(opt)
  @options[opt] = false
  value = runcmd
  @options.delete_notify(opt)
  return value
end
reset(type='cold') click to toggle source

reset the bmc device, useful for debugging and troubleshooting

# File lib/rubyipmi/freeipmi/commands/bmcdevice.rb, line 18
def reset(type='cold')
  if ['cold', 'warm'].include?(type)
    key = "#{type}-reset"
    command(key)
  else
    logger.error("reset type: #{type} is not a valid choice, use warm or cold") if logger
    raise "reset type: #{type} is not a valid choice, use warm or cold"
  end
end