EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Executing multiple commands in a row in ElSimpleSSHClient

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#4564
Posted: 12/26/2007 02:49:46
by Dan Lazarev (Basic support level)
Joined: 12/26/2007
Posts: 3

Hello ppl,

need your help if possible, I'm coding a few cisco-related scripts, baasically, I need a script that takes ip-addresses of cisco devices from txt file, logons via ssh to each one and executes a set of commands. It is pretty easy to make it execute a single command and even correctly catch the output, but when it comes to 3-4 commands in a row - problems arise ) I am using WSH as a scripting language and the ActiveX Edititon of SecureBlacbBox version 5.2.123 (Released October 3, 2007) and I can see the Commands property of ElSimpleSSHClient in the object view, but can't initialize it, it keeps firing an error on compilation stage saying "wrong flags" and pointing to the string containing Commands property initialization. I tried to create a ElStringListX object from the BaseBBox runtime library and ititialize the Commands property using it, but neither of my attempts were successful. Could you please provide me with a piece of sample code describing the consecutive one-by-one execution of the commands on the remote device without tearing the session down after the first command (like the Command property does)? I searched through entire forum before posting this message and found some clues on how to solve that, but there you recommend using CommandTunnels and I'm interested exactly in the Commands property of ElSimpleSSHClient, cause it really seems more comfortable and effective to me. Thank's for your assistance in advance.

PS. Please note, that I've read through entire forum and understood all of the explanations, tried many ways co correct the problem and in spite of this couldn't get it work, that is why a piece of sample code for WSH (VBS) will be the most appreciated feedback )) That in it's turn doesn't mean I won't provide any addititonal information by your request or cooperate in any other ways. Thanks again for your help.

Lazarev Denis.
#4565
Posted: 12/26/2007 03:03:51
by Eugene Mayevski (EldoS Corp.)

The problem is specific to the scripting environment, which doesn't like ElStringList as a parameter for the methods and probably for the property as well. I will investigate the problem later today.


Sincerely yours
Eugene Mayevski
#4566
Posted: 12/26/2007 04:01:35
by Dan Lazarev (Basic support level)
Joined: 12/26/2007
Posts: 3

Thank's for quick reply, waiting for additional information.
#4567
Posted: 12/26/2007 04:42:50
by Eugene Mayevski (EldoS Corp.)

Unfortunately there's no solution for the problem in SBB 5.2, as the bug is (as mentioned) specific to scripting environments. The property is declared as follows:

HRESULT _stdcall Commands([out, retval] IElStringListX ** Value );

VBScript engine, used in WSH and ASP, doesn't know how to handle the out parameters that return objects.

The only way would be to add some workaround methods. We will do this for SBB 6, whose beta 1 will appear this week (but I can't promise that ActiveX edition will be released in this first beta).


Sincerely yours
Eugene Mayevski
#4568
Posted: 12/26/2007 05:04:46
by Eugene Mayevski (EldoS Corp.)

Unfortunately the ActiveX edition of SBB 6 will not appear until the middle of January.


Sincerely yours
Eugene Mayevski
#4569
Posted: 12/26/2007 05:14:15
by Dan Lazarev (Basic support level)
Joined: 12/26/2007
Posts: 3

Oh, this really sounds bad to me, I need those scripts up and running till the end of this week, and the last hope for that was your ActiveX BBox, cause it's a really cool and useful in many ways project ) I'm looking forward to that upcoming beta ActiveX with corrected code for Commands property regarding WSH-scripting ) Anyways, thank's for your assistance, at least I just won't spend any more time in useless attempts to get it working till the corrected beta will be released )

Regards,
Denis Lazarev.
#4598
Posted: 12/29/2007 09:19:14
by Eugene Mayevski (EldoS Corp.)

Please check the beta 1 of SecureBlackbox 6.


Sincerely yours
Eugene Mayevski
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 2287 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!