in reply to Perl HP ilo vsp

You can put escape codes in string literals in perl. For example "\e[1;10m" is a cursor position code. Control-C is "\x03". Remoting a console program is a common task with Perl. I've written perl scripts that use pipes to a local ssh client which connects to a remote ssh server, then starts screen on the remote server and multiplexes multiple programs on the remote server, and has timeouts and creates a new console in screen, then kills the hung process in the other console after a certain time period elapses.

Replies are listed 'Best First'.
Re^2: Perl HP ilo vsp
by s4mur4i (Initiate) on May 31, 2012 at 07:55 UTC
    Hy, timeout for some reason doesn't close the connection:
    my ($output, $errput) = $kssh->capture2({timeout => 1}, "vsp");
    hangs and waits for input. Since we are on a iLO port only 1 connection at a time is allowed. Also there is no command to kill hung processes. These are the only available comands.
    HP CLI Commands: POWER : Control server power. UID : Control Unit-ID light. NMI : Generate an NMI. VM : Virtual media commands. LANGUAGE : Command to set or get default language VSP : Invoke virtual serial port. TEXTCONS : Invoke Remote Text Console.
    going to try with stin_data.
      Try sending a Control-C AKA "\x03". I'm not sure what other keys combos kill a process in linux. I'm not sure what exactly your "shell" is, are you telneting (or encrypted telnet) into the ILO module or starting a app at a prompt that connects to the ILO module? Start Wireshark (not sure if it works on Linux), start the session to the ILO module, unencrypted, do whatever key strokes you need to do by hand, stop capturing in wireshark, review the traffic for the key sequences. If you can't do it by hand at a telnet window, you can't do it with perl.

      Hi! Did you end up getting solution to this? If so, please share the same.