logicminds / rubyipmi

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

IPMI console support? #3

Open dLobatog opened 11 years ago

dLobatog commented 11 years ago

I noticed there is no support for the BMC remote shell.

ipmitool -H {YOUR BMC IP} -U {YOUR USER} -I lanplus sol activate or ipmiconsole -h {YOUR BMC IP} -u {YOUR USER} -p {YOUR PASSWORD}

on freeipmi are both ways to get it.

I'd be happy to do it and submit a pull request if you give me a few pointers on the right direction. Thanks !

logicminds commented 11 years ago

Yes, please submit a pull request. You will need to test by writing integration tests. I'll update my documentation to include more information on development. For starters just figure out the CLI method and then we can translate to ruby code.

Corey On May 17, 2013, at 1:51 AM, Daniel Lobato García notifications@github.com wrote:

I noticed there is no support for the BMC remote shell.

ipmitool -H {YOUR BMC IP} -U {YOUR USER} -I lanplus sol activate

or

ipmiconsole -h {YOUR BMC IP} -u {YOUR USER} -p {YOUR PASSWORD}

on freeipmi are both ways to get it.

I'd be happy to do it and submit a pull request if you give me a few pointers on the right direction. Thanks !

— Reply to this email directly or view it on GitHub.

logicminds commented 11 years ago

I have added some untested code that would support the console. However, I am not sure how the console features works. Maybe you can add some input. What happens after activating the sol? Where does the console get redirected to? Can I redirect the output somewhere else via ruby?

dLobatog commented 11 years ago

That should work, see here what one could get with that http://www.woodwose.net/thatremindsme/2010/08/ipmi-and-serial-over-lan-on-dell-poweredge-servers/ , http://www.hps.com/~tpg/notebook/sol.php

The main problem is the extra parameters and configuration options to use SOL with different vendors make the console almost useless if you have more than one vendor, to be fair I've stopped considering SOL in production because of that. I can't test it because of the extra conf parameters, but I would assume outputs goes to stdout, it's nothing else but characters.

sodabrew commented 10 years ago

The command to activate the console actually becomes an input/output process, so you'll need to use Popen or something like that to fork out the process and return an IO handle to the caller. Does runcmd do this?

logicminds commented 10 years ago

I am wondering if we should open a socket and just return the filepath to the socket that controls the console.

I created a console branch with the changes required, but this is completely untested. If you want to update this branch please submit a merge request on the console branch.

https://github.com/logicminds/rubyipmi/commit/4c1a4eac357dceda4311cd430d847fb0b1a60e4a

korekhov commented 7 years ago

@logicminds - Hi, Corey! Any more work done but not checked in here? With above changes, I'm definitely see SOL sessions activated and deactivated, but when the console is activated, the output is not displayed (when running in IRB), just like already mentioned a couple of comments above.

logicminds commented 7 years ago

No more work done on this. I have been focusing time elsewhere. I am guessing the output is being sent as a stream that we need to capture. How exactly does sol work on the command line now? does it open a socket and stuff data there? I think we just need to forward the connection details on activate. Can you recreate this with the CLI tools?

korekhov commented 7 years ago

Not sure what you mean by recreating with CLI tools.

"ipmitool sol activate" starts up an interactive session for the user, if that's what you're asking. This would be the biggest challenge here, IMHO. But at very least, I'd interested in rubyipmi being able to redirect the output of SOL session into a file as you mentioned.

logicminds commented 7 years ago

"starts up an interactive session for the user" What does this do exactly? Then what do you do afterwards? How does you interact with the console via ipmitool commands?

korekhov commented 7 years ago

Oh, SOL session becomes your input/output, just like "virsh console ". Unlike the latter example, to disconnect from SOL session, one needs to send "~." or "sol deactivate" from different terminal session.

beerIsGaud commented 4 years ago

Hello,

Has SOL related functionality been added to the project? I've got plenty of modern, non-branded BMC devices to help test with.

Thanks

logicminds commented 4 years ago

I have not done any more work on this. But the prior conversations would suggest the best way to implement is to just return a IO object.