# File lib/rubyipmi/ipmitool/commands/bmc.rb, line 37 def guid @options["cmdargs"] = "bmc guid" value = runcmd() @options.delete_notify("cmdargs") if value @result.lines.each { | line | line.chomp if line =~ /GUID/ line.split(":").last.strip end } end end
# File lib/rubyipmi/ipmitool/commands/bmc.rb, line 16 def info if @bmcinfo.length > 0 @bmcinfo else retrieve end end
# File lib/rubyipmi/ipmitool/commands/bmc.rb, line 12 def lan @lan ||= Rubyipmi::Ipmitool::Lan.new(@options) end
reset the bmc device, useful for troubleshooting
# File lib/rubyipmi/ipmitool/commands/bmc.rb, line 25 def reset(type='cold') if ['cold', 'warm'].include?(type) @options["cmdargs"] = "bmc reset #{type}" value = runcmd() @options.delete_notify("cmdargs") return value else raise "reset type: #{type} is not a valid choice, use warm or cold" end end
This function will get the bmcinfo and return a hash of each item in the info
# File lib/rubyipmi/ipmitool/commands/bmc.rb, line 53 def retrieve @options["cmdargs"] = "bmc info" status = runcmd @options.delete_notify("cmdargs") subkey = nil if not status raise @result else @result.lines.each do |line| # clean up the data from spaces item = line.split(':') key = item.first.strip value = item.last.strip # if the following condition is met we have subvalues if value.empty? subkey = key @bmcinfo[subkey] = [] elsif key == value and subkey # subvalue found @bmcinfo[subkey] << value else # Normal key/value pair with no subkeys subkey = nil @bmcinfo[key] = value end end return @bmcinfo end end
Generated with the Darkfish Rdoc Generator 2.