Switches, Hubs, and Modems
cancel
Showing results for 
Search instead for 
Did you mean: 

hp procurve ssh using expect

symerix
Occasional Contributor

hp procurve ssh using expect

hy,
i'm try to automate some action through an ssh connexion to my hp procurve 5308xl.
using this expect code :
#!/usr/bin/expect
#log_user 0
spawn ssh -l manager switch-hp1
expect "password:"
exp_send "mypassword"
expect "Press any key to continue"
exp_send "\r"
expect "switch-hp1#"
exp_send "show vlans\r"
log_file -a vlan-hp1
expect "switch-hp1#"

my logfile : vlan-hp1 looks like this :
^MESC[1;64rESC[64;1HESC[64;1HESC[2KESC[64;1HESC[?25hESC[64;1HESC[64;1Hswitch-hp1# ESC[64;1HESC[64;13HESC[64;1HESC[?25hESC[64;13HESC[24;13Hshow vlansESC[24;13HESC[?25hESC[24;23HESC[24;0HESCEESC[24;1
HESC[24;23HESC[24;1HESC[2KESC[24;1HESC[?25hESC[24;1HESC[1;24rESC[24;1H
^M Status and Counters - VLAN Information

^M Maximum VLANs to support : 16

doing a less on it says it's a binary file

anyone knows why and how to fix this ?

thanks for your help
1 REPLY
T. Joebstl_1
Occasional Advisor

Re: hp procurve ssh using expect

You could try playing with the console local-terminal options ("configure" - "console local-terminal none|vt100|ansi").

Regards,
Thomas