class Rubyipmi::Ipmitool::Power
Public Class Methods
new(opts = ObservableHash.new)
click to toggle source
Calls superclass method
Rubyipmi::BaseCommand::new
# File lib/rubyipmi/ipmitool/commands/power.rb, line 7 def initialize(opts = ObservableHash.new) super("ipmitool", 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/ipmitool/commands/power.rb, line 12 def command(opt) @options["cmdargs"] = "power #{opt}" value = runcmd @options.delete_notify("cmdargs") value end
power_interrupt()
click to toggle source
# File lib/rubyipmi/ipmitool/commands/power.rb, line 19 def power_interrupt command("diag") end
status()
click to toggle source
Get the power status of the system, will show either on or off
# File lib/rubyipmi/ipmitool/commands/power.rb, line 24 def status value = command("status") @result.match(/(off|on)/).to_s if value end