View Full Version : How to make the Screen Echo faster ?
liufirst
09-07-2005, 09:25 AM
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:
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?
liufirst
09-07-2005, 09:46 AM
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 ?
bocks
09-08-2005, 09:44 AM
Hi 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?
crt.screen.Syncrhonous = True
Thanks,
-bocks
liufirst
09-09-2005, 08:33 AM
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.
PugBoy
09-19-2005, 10:31 PM
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.
liufirst
09-21-2005, 02:49 AM
Thanks.
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.
PugBoy
09-22-2005, 07:54 AM
"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
liufirst
09-22-2005, 08:22 AM
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?
bocks
09-22-2005, 08:33 AM
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
vBulletin v3.5.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.