class Rubyipmi::Freeipmi::Power

Public Class Methods

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

Public Instance Methods

command(opt) click to toggle source

The command function is a wrapper that actually calls the run method

# File lib/rubyipmi/freeipmi/commands/power.rb, line 12
def command(opt)
  @options[opt] = false
  runcmd
  @options.delete_notify(opt)
  @result
end
power_interrupt() click to toggle source
# File lib/rubyipmi/freeipmi/commands/power.rb, line 19
def power_interrupt
  command("pulse")
end
status() click to toggle source

Get the power status of the system, will show either on or off

# File lib/rubyipmi/freeipmi/commands/power.rb, line 24
def status
  value = command("stat")
  @result.split(":").last.chomp.strip if value
end