class Rubyipmi::Ipmitool::Chassis

Public Class Methods

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

Public Instance Methods

bootbios(reboot = false, persistent = false) click to toggle source

boot into bios setup with option to reboot

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 72
def bootbios(reboot = false, persistent = false)
  bootstatus = config.bootbios(persistent)
  # Only reboot if setting the boot flag was successful
  power.cycle if reboot && bootstatus
  bootstatus
end
bootcdrom(reboot = false, persistent = false) click to toggle source

set boot device to cdrom with option to reboot

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 64
def bootcdrom(reboot = false, persistent = false)
  bootstatus = config.bootcdrom(persistent)
  # Only reboot if setting the boot flag was successful
  power.cycle if reboot && bootstatus
  bootstatus
end
bootdevice(device, reboot = false, persistent = false) click to toggle source

set boot device from given boot device

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 36
def bootdevice(device, reboot = false, persistent = false)
  if config.bootdevices.include?(device)
    bootstatus = config.bootdevice(device, persistent)
    power.cycle if reboot && status
  else
    logger.debug("Device with name: #{device} is not a valid boot device for host #{options['hostname']}") if logger
    raise "Device with name: #{device} is not a valid boot device for host #{options['hostname']}"
  end
  bootstatus
end
bootdisk(reboot = false, persistent = false) click to toggle source

set boot device to disk with option to reboot

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 56
def bootdisk(reboot = false, persistent = false)
  bootstatus = config.bootdisk(persistent)
  # Only reboot if setting the boot flag was successful
  power.cycle if reboot && bootstatus
  bootstatus
end
bootpxe(reboot = false, persistent = false) click to toggle source

set boot device to pxe with option to reboot

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 48
def bootpxe(reboot = false, persistent = false)
  bootstatus = config.bootpxe(persistent)
  # Only reboot if setting the boot flag was successful
  power.cycle if reboot && bootstatus
  bootstatus
end
config() click to toggle source

Access to the config command created on the fly

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 31
def config
  @config ||= Rubyipmi::Ipmitool::ChassisConfig.new(@options)
end
identify(status = false, delay = 0) click to toggle source

Turn the led light on / off or with a delay status means to enable or disable the blinking

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 9
def identify(status = false, delay = 0)
  if status
    if !delay.between?(1, 255)
      options["cmdargs"] = "chassis identify 255"
    else
      options["cmdargs"] = "chassis identify #{delay}"
    end
  else
    options["cmdargs"] = "chassis identify 0"
  end
  # Run the command
  value = runcmd
  options.delete_notify("cmdargs")
  value
end
identifystatus() click to toggle source

A currently unsupported method to retrieve the led status

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 87
def identifystatus
  options["cmdargs"] = "chassis identify status"
  value = runcmd
  options.delete_notify("cmdargs")
  @result.chomp.split(":").last.strip if value
end
power() click to toggle source

Access to the power command created on the fly

# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 26
def power
  @power ||= Rubyipmi::Ipmitool::Power.new(@options)
end
status() click to toggle source
# File lib/rubyipmi/ipmitool/commands/chassis.rb, line 79
def status
  options["cmdargs"] = "chassis status"
  value = runcmd
  options.delete_notify("cmdargs")
  {:result => @result, :value => value}
end