Skip to content

Add support for raw IPMI commands #45

@korekhov

Description

@korekhov

Something like this, I'd imagine (very simplified version, but even that does not work for me, so looking for your guidance here):


module Rubyipmi::Ipmitool
  class Raw < Rubyipmi::Ipmitool::BaseCommand
    def initialize(opts = ObservableHash.new)
      super("ipmitool", opts)
    end

    def raw_cmd(opt)
      @options["cmdargs"] = "raw #{opt}"
      value = runcmd
      @options.delete_notify("cmdargs")
      if value
        @result
      end
    end

    def test
      raw_cmd("0x00")
    end

  end
end

WIth the following added to lib/rubyipmi/ipmitool/connection.rb

      def raw
        @raw ||= Rubyipmi::Ipmitool::Raw.new(@options)
      end

I get the following output:

# irb
irb(main):001:0> require 'rubyipmi'
=> true
irb(main):002:0> conn = Rubyipmi.connect("root", "root", "<IP>", "ipmitool")
=> #<Rubyipmi::Ipmitool::Connection:0x000000011b2898 @options={"H"=>"<IP>", "U"=>"root", "P"=>"root", "I"=>"lanplus"}>
irb(main):003:0>
irb(main):004:0* conn.raw.test
=> nil
irb(main):005:0>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions