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

Plink and HP Switches

Go to solution
Frequent Advisor

Plink and HP Switches

Hi all,


I try to create a Script that saves my config to a tftp server. I want to use plink, but if I write a character I get senseless character strings back:


We'd like to keep you up to date about:
  * Software feature updates
  * New product announcements
  * Special events

Please register your products now at:  www.ProCurve.com

←[2J←[?7l←[3;23r←[?6l←[1;1H←[?25l←[1;1HProCurve J8770A Switch 4204vl
Software revision L.11.24

Copyright (C) 1991-2010 Hewlett-Packard Co.  All Rights Reserved.

                           RESTRICTED RIGHTS LEGEND

 Use, duplication, or disclosure by the Government is subject to restrictions
 as set forth in subdivision (b) (3) (ii) of the Rights in Technical Data and
 Computer Software clause at 52.227-7013.

         HEWLETT-PACKARD COMPANY, 3000 Hanover St., Palo Alto, CA 94303

←[24;1HPress any key to continue←[1;1H←[?25h←[24;27H←[2J←[?7l←[3;23r←[?6l←[24;27
←[24;1H←[1;24r←[24;1H←[24;1H←[2K←[24;1H←[?25h←[24;1H←[24;1HLHG-HUB354# ←[24;1H←[


If I use plink to an Cisco Device everthing works fine...

And please dont tell me that PCM is able to save the configs...

Can somebody help me? Or do you know an alternate scriptable ssh-client.

Honored Contributor

Re: Plink and HP Switches

Well, these are not senseless character strings but good old fashioned ANSI escape codes. CSI (Escape [) 2J is clear screen, for example. Some vendors run their console in vt100 like mode, others a dumb tty. If you're using PuTTY rather than Plink it all works fine. Adding ANSI support is  however WONTFIXed in Plink http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/plink-terminal.html


RANCID, which is a config management program for routers, uses the hpuifilter tool to strip these codes. It wouldn't be hard to knock together something similar: a few regexps in Powershell or whatever your favourite scripting tool is, should soon see them off. Do you care about the output though if you are using TFTP, rather than parsing the console about as RANCID does?


The other option would be to poke about in the private MIBs rather than script a session. That would be more elegant but probably more work, and less portable. I hope that's not too close to telling you to use PCM.





Frequent Advisor

Re: Plink and HP Switches

Hallo Richard,


thx for your reply.

I could make my script with Kitty. Now I can get all our Switches from whatsup gold Database and save periodcally the config to tftp.