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 09-07-2005, 09:25 AM
liufirst liufirst is offline
Registered User
 
Join Date: Aug 2005
Posts: 27
How to make the Screen Echo faster ?

Hello.
When I use "sh ip nat tran" in my session to control my cisco Router, the router will answer almost 8000 lines echo, and stop when screen is full, if I press ENTER, the next line will appeer, If I press SPACE , next screen will appeer, so I use this code:

Code:
		CRT.Screen.Send " "
		flag = CRT.Screen.WaitForStrings("-More-" , "Router#",5)
		
		if flag = 2  then
			'msgbox "return Router#"
			currRow = Crt.Screen.CurrentRow -1

My problem is, When I run this code, the screen looks answer me slowly, new screen will appear after about 5-7 seconds, How to change it to make it faster?
Reply With Quote
  #2  
Old 09-07-2005, 09:46 AM
liufirst liufirst is offline
Registered User
 
Join Date: Aug 2005
Posts: 27
It looks that the Program runs more and more slowly?

Because My program deal with 8000 lines strings, After a while, It looks my system echo slowly, Is there any good way to avoid it happens ?
Reply With Quote
  #3  
Old 09-08-2005, 09:44 AM
bocks's Avatar
bocks bocks is offline
VanDyke Customer Support
 
Join Date: Jan 2004
Location: Albuquerque, NM
Posts: 184
Hi liufirst,
Quote:
Originally Posted by liufirst
Because My program deal with 8000 lines strings, After a while, It looks my system echo slowly, Is there any good way to avoid it happens ?
In order to understand why you are seeing this behavior, I am going to need some additional information.

Can you tell me what version and build of CRT you are using?

Are you logging this session?

In your script, do you have synchronous set to true at the top of your script?

Code:
crt.screen.Syncrhonous = True
Thanks,

-bocks
Reply With Quote
  #4  
Old 09-09-2005, 08:33 AM
liufirst liufirst is offline
Registered User
 
Join Date: Aug 2005
Posts: 27
Hello, thanks for your answer.

My script is working on Windows 2000 or 98 system with secureCRT 5.02.
I'll log the session and upload it .
In my script, there are several subroutines, I'll set synchronous to true before using CRT.Screen object and set it to false after using the object.
The problem that I want to solve is:
My router ( cisco 7206) provides almost 400 users to visit Internet. It works better before BT coming to the world and when the router's CPU load is less than 15%.
After BT download changed a main download tool, my router's CPU load is always so high that sometimes it was stopping work and need to be reloaded. the CPU load will increase to 99-100% in 0.5-1 hour.
Using the way coming from cisco, I prevented BT download, but users were angry. So I had to permit users using BT.
If using the way to limit Bt from cisco, my router's CPU load will always be 99-100%, it means the router is stop working.
So I use a script to test the CPU load, When the load is bigger than 90%, script will use "clear ip nat tran *" command to clear the connection, and it is effcient to decrease the cpu load.
But when the "clear ip nat tran *" command runs, all online game and other online program will be stoped.
So I try to use "clear ip nat tran tcp (inside global) (inside local) (outside global) (outside local)" command to clear a single connection. script will not running the "clear" command if the port is a game's port.
Now the problem is:
1. When I read the connections by using "show ip nat tran", there are almost 8000 lines, so script need time to read, it is about 10- 15 minutes, in the time, the CPU load will increase to very high sometimes. So I need some way to read the connection quickly.
2. When I use "clear ip nat tran tcp (inside global) (inside local) (outside global) (outside local)" command by script, the script runs so fast and the router's CPU load would increase to very high.
thanks.
Reply With Quote
  #5  
Old 09-19-2005, 10:31 PM
PugBoy PugBoy is offline
Registered User
 
Join Date: Sep 2005
Posts: 2
change the router not your script.

Hello liufirst,
I think that rather than responding to the -- more -- prompt on the router, you would be better off setting an infinite page length before running your command.

'term length 0' will stop the router from paging it's output and just give it all to you in one go. This will also simplify your script and make it easier to maintain.
Reply With Quote
  #6  
Old 09-21-2005, 02:49 AM
liufirst liufirst is offline
Registered User
 
Join Date: Aug 2005
Posts: 27
Thanks.
Quote:
Originally Posted by PugBoy
Hello liufirst,
I think that rather than responding to the -- more -- prompt on the router, you would be better off setting an infinite page length before running your command.

'term length 0' will stop the router from paging it's output and just give it all to you in one go. This will also simplify your script and make it easier to maintain.
Where can I set 'term length 0' ?
or if I need to set 500 col in one screen, Can I set it in the scripting?
thanks.
Reply With Quote
  #7  
Old 09-22-2005, 07:54 AM
PugBoy PugBoy is offline
Registered User
 
Join Date: Sep 2005
Posts: 2
term length 0

"term length 0" is a Cisco command and will stop the router from pausing at page intervals and displaying the -- more -- prompt.

It should probably be the first command you issue to the router after logging in. (Only need to do it once per telnet session).

Regards,
PugBoy
Reply With Quote
  #8  
Old 09-22-2005, 08:22 AM
liufirst liufirst is offline
Registered User
 
Join Date: Aug 2005
Posts: 27
I think It would be useless.

Thanks for your answer.
I think that I can not get the information by CRT.SCREEN.GET Function if the router does not stop. because We have no a function in SecureCRT to receive the strings stream. We can get the information only from CRT.SCREEN object.
Do you have any good way to receive all strings stream from the router?
Reply With Quote
  #9  
Old 09-22-2005, 08:33 AM
bocks's Avatar
bocks bocks is offline
VanDyke Customer Support
 
Join Date: Jan 2004
Location: Albuquerque, NM
Posts: 184
Hi liufirst,

Can you tell me if you are logging the session when you connect?

If so, can you try downloading and installing the current version of SecureCRT - 5.0.3 and let me know how this version works for you?

There was a change made in SecureCRT 5.0.2 to better support logging of multiple sessions to the same log file. But, it had a side effect of slowing down the display when only a single session was being logged. Thie has been resolved in the 5.0.3 build.

Once we get this resolved, we can look at the script to see if we can make some changes to help speed things up.

Thanks,

-bocks
Reply With Quote
Reply


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 01:43 AM.