logicminds / rubyipmi

Command line wrapper for ipmitool and freeipmi
GNU Lesser General Public License v2.1
35 stars 32 forks source link

Need to be able to specify the lan_2_0 driver #25

Closed xjparkerx closed 9 years ago

xjparkerx commented 9 years ago

I am using rubyipmi through foreman for ipmi power operations. I am able to successfully perform a power cycle on a Dell R720 via the iDRAC interface when using this command: ipmipower -D LAN_2_0 -h hostname -u root -p --stat

I configured my /etc/freeipmi.conf file to reflect the LAN_2_0 driver so that option will be passed every time ipmipower is ran but this still doesn't seem to help rubyipmi.

Any help would greatly be appreciated. Justin

logicminds commented 9 years ago

Rubyipmi is supposed to figure this out automatically. If this isn't happening let me know. You can also supply the driver type manually if you want.

conn = Rubyipmi.connect(user,pass,host,'any',{:driver => 'lan20'})

https://github.com/logicminds/rubyipmi/blob/master/lib/rubyipmi/ipmitool/connection.rb#L30

xjparkerx commented 9 years ago

Thanks so much for the reply. Do you have any suggestions of a way I can isolate the problem being Foreman or it being rubyipmi?

logicminds commented 9 years ago

First see if it works with Rubyipmi.

Try the following:

  1. Install this gem gem install rubyipmi
  2. run irb (Ruby program)
  3. enter the code in irb below
require 'rubyipmi'
conn = Rubyipmi.connect(user,pass,host)
conn.chassis.power.status

The more impi output you can provider the better code I can write. I wrote this with only one server to test against and by luck it seems to work for others too. Just be sure to remove any sensitive info.

xjparkerx commented 9 years ago

Awesome! Thanks so much for your help I am learning a lot! I ran your test code and am getting a connection timeout error.

logicminds commented 9 years ago

what version of freeipmi are you using? Also can you run

require 'rubyipmi'
conn = Rubyipmi.connect(user,pass,host)
puts conn.inspect
logicminds commented 9 years ago

@xjparkerx what did you find out? What kind of hardware are you using? Is your impi device accessible on the network?

logicminds commented 9 years ago

Please see rubyipmi 0.9.0