View Single Post
  #2  
Old 06-04-2016, 11:17 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 940
When Synchronous is set to True, SecureCRT does not display any data to the terminal screen until you call WaitFor*() or ReadString().

What's happening in your case is you've told SecureCRT's script engine to send a command, and immediately after sending that command, you've told SecureCRT's script engine to turn off Synchronous and then turn off logging.

Since you haven't waited for the data to arrive (and be displayed to the terminal screen), there's nothing (or perhaps very little, if anything) that gets logged because you told SecureCRT to stop logging. This happens in script code so quickly that either no data has even arrived yet from the device, or it has but since Synchronous is still set to True when it does arrive, and none of it has been displayed to the screen (and therefore isn't available to be logged).

You can solve the problem by adding a crt.Screen.WaitForString("Put_Your_Shell_Prompt_Here") line right before you turn off Synchronous.

If you're having trouble figuring out how to automatically determine what your shell prompt is on the remote device, either a) try to use something that's unique enough that it wouldn't show up in the command output, but the same on all your different devices, or b) read about heuristically determining the shell prompt as described in the SecureCRT Scripting Guide (see example code on pages 92 and 114 as a good starting point).

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote