Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-05-2015, 04:10 AM
maapinho maapinho is offline
Registered User
 
Join Date: Apr 2015
Posts: 5
Trace script execution

Hi,
Im developing a script for a customer (read file with hosts, execut commands from another file) and while developing remote from the VPN works great.
However, as we go and test the script in the LAN it works 1 out of 3 times. No change in files or anything.

Is there a way to trace the script execution and see whats going on? Also sometimes it looks like maybe the characters are coming faster than the script can read with WaitforString since the string comes but it just gets stuck waiting. Is this possible?

Thanks

Mario
Reply With Quote
  #2  
Old 05-05-2015, 08:27 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,423
Hello Mario,

There are many unknowns.

What version of SecureCRT are you using?

On what platform?

When you say it works 1 out of 3 times, are you saying you get an error for those two failure cases?

Or does the script just not complete execution two times?
If so, is Cancel available from the Script menu? If so and you select it, what is the error?

Quote:
Is there a way to trace the script execution and see whats going on? Also sometimes it looks like maybe the characters are coming faster than the script can read with WaitforString since the string comes but it just gets stuck waiting. Is this possible?
You can debug the script execution if you include debug statements in the script (ie: write comments to a log file).

The above description sounds like a synchronous issue. Did you set synchronous to True?

See information about the importance of Synchronous in section 4.2 of the scripting manual here.

The topic header is:
Avoid "Missing" Data with Screen.Synchronous = True
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 05-06-2015, 05:19 AM
maapinho maapinho is offline
Registered User
 
Join Date: Apr 2015
Posts: 5
Hi,
Sorry. more details below. You can find the script in the link at the end.
Im using securert 6.1.1 on win7 64bits. Don't know the details of the other PCs I tested in but they were all win7.

Synchronous has been true since the beginning. I recently I also put IgnoreEscape = True.

The kind of errors I get are:

The word "Username:" comes in but the script does not act on it and just keeps waiting.

Other error I got was on the if in line 69 after sending strPassword, the script sends the commands even though the credentials were incorrect (I get another "Username:" prompt and not the "#" prompt.

One note is the server is a Windows server telnet server used as jump server which only works with secureCRT. There is something wrong with that as it does not keep history lines.

Link to script
Reply With Quote
  #4  
Old 05-06-2015, 02:29 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,423
Hello Mario,

It will take me some time to look over your script.

Please note that SecureCRT v6.1.1 is not considered compatible with Windows 7. The first version of SecureCRT to support Windows 7 was v6.5.x. You can check your upgrade eligibility here.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 05-08-2015, 05:24 AM
maapinho maapinho is offline
Registered User
 
Join Date: Apr 2015
Posts: 5
I just tried it with the latest version 7 in trial and I get the same behavior.

But now Im seriously starting to think its actually a server problem.

I did packet captures and traffic comes with some seriously strange characters. Since its telnet it would be all cleartext and I have done many captures where you clearly see what was exchanged.

The picture below show traffic captured when one of the errors occured. The SecureCRT window shows me "Username:" but clearly the word Username has not come from the server. Its like it sends a command to the terminal or something.

[IMG]C:\Users\mpinho\Documents\TEMP\capture-securecrt.PNG[/IMG]

Only after the time to enter username expires we get traffic from the server with the characters "Username" and once again a lot of strange characters.

[IMG]C:\Users\mpinho\Documents\TEMP\capture-securecrt2.PNG[/IMG]
Reply With Quote
  #6  
Old 05-08-2015, 08:26 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,423
Hello Mario,

Your images did not post, but we probably won't need them.

The behavior you describe makes me think there is a configuration option that may benefit you.

In the Connection / Telnet category of SecureCRT's Session Options, is Force character at a time mode enabled?

If not and you enable it, do you see different results?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 05-08-2015, 09:20 AM
maapinho maapinho is offline
Registered User
 
Join Date: Apr 2015
Posts: 5
Hi,
Was disabled. I enabled it but got the same results.
Reply With Quote
  #8  
Old 05-08-2015, 09:33 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,423
Hello Mario,

I think it's time we saw those screenshots that failed to post.

Could you attach those to an email sent to support@vandyke.com? Please also reference "Attn Brenda - Forum Thread 11965" in the subject line.

Please include your SecureCRT serial number so if we find the solution is in some intermediate version between what you were using and current version we can determine what version your license is actually eligible to be used with.

I have some other suggestions to capture troubleshooting info, but I will wait to receive your email.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #9  
Old 05-08-2015, 10:15 AM
maapinho maapinho is offline
Registered User
 
Join Date: Apr 2015
Posts: 5
E-mail sent.

Mario
Reply With Quote
Reply

Tags
trace , waitforstring


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:58 PM.