Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Perl HP ilo vsp

by salva (Abbot)
on May 29, 2012 at 20:44 UTC ( #973119=note: print w/replies, xml ) Need Help??

in reply to Perl HP ilo vsp

capture2 accepts an stdin_data options where you can pass the escape sequence used to end the command:
my ($out, $err) = $kssh->capture2({stdin_data => $escape_seq}, "vsp");

Replies are listed 'Best First'.
Re^2: Perl HP ilo vsp
by s4mur4i (Initiate) on May 31, 2012 at 08:15 UTC
    Hy, I tried with piping the keystrokes, but it doesn,t help. As I figured ESC+( is \x{27}(
    my $escape_seq="\x{27}("; my ($output, $errput) = $kssh->capture2({stdin_data => $escape_seq}, " +vsp"); print "my output is:'$output'\n";
    But command just hangs, only killing the process will it terminate. even tried with ^[( same problem.
      Well, getting this kind of devices to work often involves a considerable amount of trial an error until you find the exact combination of options.

      Try requesting a tty on the remote side:

      my ($output, $errput) = $kssh->capture2({tty => 1, stdin_data => $esca +pe_seq}, "vsp");
      Or adding some carrier returns before the escape sequence.

      Maybe the device will not accept the sequence until it has send some prompt. In that case, you will like to use Expect, or just use open2 to read the data and send the escape sequence when it is done.

      Try also with a timeout and setting the kill_ssh_on_timeout flag.

        Yup, its alot of playing around with...:( Expect dies with errors, even tried to switch to raw mode didnt help.
        tcsetattr: Input/output error
        basically there is traffic, ssh is sending keep alives so timeout is set from server side to 60 seconds, which is to long.. setting timeout on my side doesnt change anything.. its interesting. added \n but didnt help.. I tried with a fork and to create piped filehandels but no information was sent to the main process... I guess hp has a very odd TTY implementation.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973119]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-10-24 08:32 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (286 votes). Check out past polls.