Open korekhov opened 7 years ago
The expected result from above:
# ipmitool -I lanplus -U root -P root -H <IP> raw 0x00
Not enough parameters given.
RAW Commands: raw <netfn> <cmd> [data]
Network Function Codes:
VAL HEX STRING
==============================================
0 0x00 Chassis
2 0x02 Bridge
4 0x04 SensorEvent
6 0x06 Application
8 0x08 Firmware
10 0x0a Storage
12 0x0c Transport
(can also use raw hex values)
Never mind - since the exit code of running "raw 0x00" is actually "1", the code works properly as "value" does not get set to true so never returns the output received from BMC.
If change the code to this:
def raw_cmd(opt)
@options["cmdargs"] = "raw #{opt}"
value = runcmd
@options.delete_notify("cmdargs")
@result
end
everything works fine and I get this output:
irb(main):006:0* conn.raw.test
=> "Not enough parameters given.\nRAW Commands: raw <netfn> <cmd> [data]\n\nNetwork Function Codes:\n\n VAL\tHEX\tSTRING\n==============================================\n 0\t0x00\tChassis\n 2\t0x02\tBridge\n 4\t0x04\tSensorEvent\n 6\t0x06\tApplication\n 8\t0x08\tFirmware\n 10\t0x0a\tStorage\n 12\t0x0c\tTransport\n\n(can also use raw hex values)\n"
irb(main):007:0>
Something like this, I'd imagine (very simplified version, but even that does not work for me, so looking for your guidance here):
WIth the following added to lib/rubyipmi/ipmitool/connection.rb
I get the following output: