Hi,
+-From: "Stijn Verstichel" <[email protected]> --
|_Date: Thu, 19 Aug 2010 19:20:41 +0200 _______________________
|
|For the execution of a remote command to retrieve the power consumption of
|certain devices on certain ports of an HP ProCurve 2600 switch, we were
|investigating the usage of JSCH, more specifically the exec example from the
|jsch distribution. However, we seem to bump into an issue using this
|approach, because the switch returns some kind of welcome screen. See below
|for an example. Therefore, the command is not executed remotely. At least we
|think, because we cannot receive any output. Has any of you been successful
|in such a use case, of has any examples or references available towards the
|correct JSCH usage?
|ProCurve J8164A Switch 2626-PWR
|Software revision H.10.38
|Copyright (C) 1991-2007 Hewlett-Packard Co. All Rights Reserved.
|Press any key to continue
As above message says, is it enough to send something?
Channel channel = session.openChannel("exec");
((ChannelExec)channel).setCommand(command);
OutputStream out = channel.getOutputStream();
InputStream in = channel.getInputStream();
channel.connect();
byte[] enter = {(byte)0x0d}
out.write(enter);
out.flush();
// read data from in
...
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: @ymnk
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users