Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 07-12-2013, 06:07 PM
thehawk thehawk is offline
Registered User
Join Date: Oct 2012
Posts: 7
TELNET Time-out too long


I am using SecureCRT6.2.2 with Active Perl scripting.

I am creating a script that connects to remote routers and grabs information from them. Some of these routers are down at the time when I run the script and the script waits about 30-60 seconds before declaring the TELNET session down and moves on to the next site. If I need to check 100 routers and I wait for 30-60 per site that's down I could be running the script for 20+ minutes. Is there a way to put a limit of 10 or 5 seconds on the TELNET?

For example,
If I don't get a prompt in 5 seconds then skip this connection and move to the next one.

I tried something like this but it doesn't work:
sub CheckCon
$crt->session->Connect("/TELNET $wanip");

if ($crt->session->Connected())
$connectiondown = "No";
$connectiondown = "Yes";
sub LogintoDevice
$rescheck = $crt->Screen->WaitForStrings ("Login:", 10);
if ($rescheck == 0)
print FAILLOGIN "Telnet_timeout\n";
elsif ($rescheck == 1)
$crt->Screen->Send ("$AdminUser\n");
$crt->Screen->WaitForString ("assword:");
$crt->Screen->Send ("$AdminPasswd\n");

Thank you for your time
Reply With Quote
Old 07-15-2013, 07:36 AM
rtb rtb is offline
VanDyke Technical Support
Join Date: Aug 2008
Posts: 4,305
Hi Adrian,

You could handle authentication in the terminal window to avoid this issue.

We have an example in VBScript that illustrates how to accomplish this:
Does this help you accomplish your goal?

VanDyke Software
Technical Support
Reply With Quote

telnet , timeout , waitforstring

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 03:29 AM.