#1
|
|||
|
|||
can't telnet to winxp logging?
hi,
For some reason when I try to close the log file in script it generates an empty file. I am using the following code: Set b = crt.session.ConnectInTab("/telnet 192.168.16.10 23") b.Screen.Send vbCr b.Screen.Send "Administrator"&vbCr b.Screen.Send vbCr {do something else............} b.activate b.screen.Synchronous = True b.Session.LogFileName = "D:\1.log" b.Session.Log True,True b.screen.waitforstring ">",1 b.Screen.Send vbCr b.Screen.Send("ftp 200.200.200.120"&vbCr) b.Screen.Send("test"&vbCr) b.Screen.Send("test"&vbCr) b.screen.WaitForString "ftp>",2 b.Screen.Send("get "&downfile&vbCr) b.screen.WaitForString "ftp>",2 b.Screen.Send("get "&upfile&vbCr) b.screen.WaitForString "ftp>",20 b.Screen.Send("by"&vbCr) b.screen.waitforstring ">",10 b.Screen.Send vbCr crt.sleep 20000 b.Session.Log False b.screen.Synchronous = False can anyone help me?thanks for your help. |
#2
|
||||
|
||||
Hi Foggycactus,
I just had a couple of questions. Is this SecureCRT or CRT? Which version is installed? This can be found by selecting 'About <product>' from the 'Help' menu. If the same series of steps is run manually in the terminal window, does the log file have information in it or is it still empty?
__________________
Thanks, Teresa Teresa Nygren |
#3
|
|||
|
|||
![]()
hi,tnygren
it's SecureCRT Version 5.5.2(build 475) sorry,I don't know how to set log file while it run manually in the terminal window,but when I telnet to router,it's not empty,the code is blow: Set a = crt.session.ConnectInTab("/telnet 192.168.16.1") a.activate a.Session.LogFileName = CurrentPath &"\ftptest_"&t&".log" a.Session.Log True a.Screen.Send("Set interface ethernet/1 rxBPS "&maxdown&vbCr) a.Screen.WaitForString "hiper%",1 a.Screen.Send("set interface ethernet/1 txBPS "&maxup&vbCr) a.Screen.WaitForString "hiper%",1 a.Screen.Send("set cbt mDRRquantumTx "&mindown&vbCr) a.Screen.WaitForString "hiper%",1 a.Screen.Send("set cbt mDRRquantum "&minup&vbCr) a.Screen.WaitForString "hiper%",1 a.Screen.Send("write"&vbCr) a.Screen.Send("sh r"&vbCr) a.Screen.Send vbCr crt.sleep 1000 a.Session.Log False |
#4
|
||||
|
||||
Hi Foggycactus,
Logging can be enabled manually by selecting the 'Log Session' option from the 'File' menu and selecting a log file name and path. Once started, just perform the same steps that the script performs. To stop the logging manually, just select the 'Log Session' option again. Is a log file created when these steps are used?
__________________
Thanks, Teresa Teresa Nygren |
#5
|
|||
|
|||
![]() Welcome to Microsoft Telnet Service login: Administrator factly,the operational process displayed on CRT is below: *=============================================================== Welcome to Microsoft Telnet Server. *=============================================================== C:\Documents and Settings\Administrator>ftp 1.1.1.1 ^C C:\Documents and Settings\Administrator>ftp 200.200.200.30 ^C C:\Documents and Settings\Administrator>ftp 192.168.16.10 Connected to 192.168.16.10. 220 Serv-U FTP Server v6.0 for WinSock ready... User (192.168.16.10 ![]() 331 User name okay, need password. Password: 230 User logged in, proceed. ftp> ls 200 PORT Command successful. 150 Opening ASCII mode data connection for /bin/ls. 1000m 10M.txt If I select the 'Log Session' option and 'Trace Option',sometimes the log file is same as foregoing file,some times these words will discover in log file: SecureCRT - Version 5.5.2 (build 475) SENT do SUPPRESS GO AHEAD SENT will TERMINAL TYPE RCVD will ECHO SENT do ECHO RCVD will SUPPRESS GO AHEAD RCVD do NEW ENVIRON SENT wont NEW ENVIRON RCVD do NAWS SENT will NAWS RCVD do BINARY SENT will BINARY RCVD will BINARY SENT do BINARY RCVD do TERMINAL TYPE Welcome to Microsoft Telnet Service login: Adminin starto rator password: [1;1H[K[2;1H[K[3;1H[K[4;1H[K[5;1H[K[6;1H[K[7;1H[K[8;1H[K[9;1H[K[10;1H[K[11;1H[K[12;1H[K[13;1H[K[14;1H[K[15;1H[K[16;1H[K[17;1H[K[18;1H[K[19;1H[K[20;1H[K[21;1H[K[22;1H[K[23;1H[K[24;1H[K[25;1H[K[26;1H[K[27;1H[K[28;1H[K[29;1H[K[30;1H[K[31;1H[K[32;1H[K[33;1H[K[34;1H[K[35;1H[K[36;1H[K[37;1H[K[38;1H[K[39;1H[K[40;1H[K[41;1H[K[42;1H[K[43;1H[K[44;1H[K[45;1H[K[46;1H[K[47;1H[K[1;1H[1;1H* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = [2;1HW e l c o m e t o M i c r o s o f t T e l n e t S e r v e r . [3;1H* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =[18;1HC : \ D o c u m e n t s a n d S e t t i n g s \ A d m i n i s t r a t o r > [18;41H[18;41Hf [18;42H[18;42Ht [18;43H[18;43Hp [18;44H[18;45H[18;45H1 [18;46H[18;46H9 [18;47H[18;47H2 [18;48H[18;48H. [18;49H[18;49H1 [18;50H[18;50H6 [18;51H[18;51H. [18;52H[18;51H [18;51H[18;51H8 [18;52H[18;52H. [18;53H[18;53H1 [18;54H[18;54H6 [18;55H[18;55H. [18;56H[18;56H1 [18;57H[18;57H0 [18;58H[19;1H[19;1HC o n n e c t e d t o 1 9 2 . 1 6 8 . 1 6 . 1 0 . [20;1H2 2 0 S e r v - U F T P S e r v e r v 6 . 0 f o r W i n S o c k r e a d y . . . [21;1HU s e r ( 1 9 2 . 1 6 8 . 1 6 . 1 0 : ( n o n e ) ) : [21;30H[21;30Ht [21;31H[21;31He [21;32H[21;32Hs [21;33H[21;33Ht [21;34H[22;1H3 3 1 U s e r n a m e o k a y , n e e d p a s s w o r d . [23;1HP a s s w o r d : [23;11H[24;1H2 3 0 U s e r l o g g e d i n , p r o c e e d . [25;1Hf t p > [25;6H[26;1Hf t p > [26;6H[26;6Hl [26;7H[26;7Hs [26;8H[1;1HR e p l y f r o m 1 9 2 . 1 6 8 . 1 6 . 1 0 : b y t e s = 3 2 t i m e < 1 m s T T L = 1 2 8 [2;1HR e p l y f r o m 1 9 2 . 1 6 8 . 1 6 . 1 0 : b y t e s = 3 2 t i m e < 1 m s T T L = 1 2 8 [3;1HR e p l y f r o m 1 9 2 . 1 6 8 . 1 6 . 1 0 : b y t e s = 3 2 t i m e < 1 m s T T L = 1 2 8 [4;1H[K[5;1HP i n g s t a t i s t i c s f o r 1 9 2 . 1 6 8 . 1 6 . 1 0 : [6;1H P a c k e t s : S e n t = 4 , R e c e i v e d = 4 , L o s t = 0 ( 0 % l o s s ) , [7;1HA p p r o x i m a t e r o u n d t r i p t i m e s i n m i l l i - s e c o n d s : [8;1H M i n i m u m = 0 m s , M a x i m u m = 0 m s , A v e r a g e = 0 m s [9;1H[K[10;1HC : \ D o c u m e n t s a n d S e t t i n g s \ A d m i n i s t r a t o r > f t p 1 9 2 . 1 6 8 . 1 6 . 1 0 [11;1HC o n n e c t e d t o 1 9 2 . 1 6 8 . 1 6 . 1 0 . [12;1H2 2 0 S e r v - U F T P S e r v e r v 6 . 0 f o r W i n S o c k r e a d y . . . [13;1HU s e r ( 1 9 2 . 1 6 8 . 1 6 . 1 0 : ( n o n e ) ) : t e s t [14;1H3 3 1 U s e r n a m e o k a y , n e e d p a s s w o r d . [15;1HP a s s w o r d : [16;1H2 3 0 U s e r l o g g e d i n , p r o c e e d . [17;1Hf t p > [18;1Hf t p > l s [19;1H2 0 0 P O R T C o m m a n d s u c c e s s f u l . [20;1H1 5 0 O p e n i n g A S C I I m o d e d a t a c o n n e c t i o n f o r / b i n / l s . [21;1H1 0 0 0 m [22;1H1 0 M . t x t [23;1H1 2 8 K . t x t [24;1H1 2 8 M . r a r [25;1H1 2 M . r a r [26;1H1 4 M . r a r [27;1H1 M . t x t [28;1H2 5 6 K . t x t [29;1H2 M . t x t [30;1H3 0 M . t x t [31;1H3 M . r a r [32;1H3 M . t x t [33;1H5 1 2 K . t x t [34;1H5 4 M . r a r [35;1H6 4 K . t x t [36;1H6 M . r a r [37;1H9 2 M . r a r [38;1HN T U S E R . D A T [39;1Hi p . t x t [40;1Hn t u s e r . d a t . L O G [41;1Hn t u s e r . i n i [42;1Hq q 2 0 0 7 _ 1 9 M . e x e [43;1Hu p d o w n . t x t [44;1Hu p d o w n 2 . t x t [45;1H2 2 6 T r a n s f e r c o m p l e t e . [46;1Hf t p : 收 到 2 3 9 字 节 , 用 时 0 . 0 0 S e c o n d s 2 3 9 0 0 0 . 0 0 K b y t e s / s e c . [47;1Hf t p > [47;6H[47;6Hb [47;7H[47;7Hy [47;8H[1;1H[K[2;1HP i n g s t a t i s t i c s f o r 1 9 2 . 1 6 8 . 1 6 . 1 0 : [3;1H P a c k e t s : S e n t = 4 , R e c e i v e d = 4 , L o s t = 0 ( 0 % l o s s ) , [4;1HA p p r o x i m a t e r o u n d t r i p t i m e s i n m i l l i - s e c o n d s : [5;1H M i n i m u m = 0 m s , M a x i m u m = 0 m s , A v e r a g e = 0 m s [6;1H[K[7;1HC : \ D o c u m e n t s a n d S e t t i n g s \ A d m i n i s t r a t o r > f t p 1 9 2 . 1 6 8 . 1 6 . 1 0 [8;1HC o n n e c t e d t o 1 9 2 . 1 6 8 . 1 6 . 1 0 . [9;1H2 2 0 S e r v - U F T P S e r v e r v 6 . 0 f o r W i n S o c k r e a d y . . . [10;1HU s e r ( 1 9 2 . 1 6 8 . 1 6 . 1 0 : ( n o n e ) ) : t e s t [11;1H3 3 1 U s e r n a m e o k a y , n e e d p a s s w o r d . [12;1HP a s s w o r d : [13;1H2 3 0 U s e r l o g g e d i n , p r o c e e d . [14;1Hf t p > [15;1Hf t p > l s [16;2H0 0 P O R T C o m m a n d s u c c e s s f u l [17;1H1 5 0 O p e n i n g A S C I I m o d e d a t a c o n n e c t i o n f o r / b i n / l s . [18;1H1 0 0 0 m [19;1H1 0 M . t x t [20;2H2 8 K . t x t [21;2H2 8 M . r a r [22;2H2 M . r a r [23;2H4 M . r a r [24;2HM . t x t [25;1H2 5 6 K . t x t [26;1H2 M . t x t [27;1H3 0 M . t x t [28;1H3 M . r a r [29;1H3 [30;1H5 1 2 K . t x t [31;1H5 4 M . r a r [32;1H6 4 K . t x t [33;1H6 M . r a r [34;1H9 2 [35;1HN T U S E R . D A T [36;1Hi p . t x t [37;1Hn t u s e r . d a t . L O G [38;1Hn t u s e r . i n i [39;1Hq q 2 0 0 7 _ 1 9 M . e x e [40;1Hu p d o w n . t x t [41;1Hu p d o w n 2 . t x t [42;1H2 2 6 T r a n s f e r c o m p l e t e . [43;1Hf t p : 收 到 2 3 9 字 节 , 用 时 0 . 0 0 S e c o n d s 2 3 9 0 0 0 . 0 0 K b y t e s / s e c . [44;1Hf t p > b y [45;3H1 G o o d b y e ! [46;1H[K[47;1HC : \ D o c u m e n t s a n d S e t t i n g s \ A d m i n i s t r a t o r > [47;41H |
#6
|
|||
|
|||
Hello foggycactus
It looks like the problem you are running into is that SecureCRT is only able to log a line of data when it receives a carriage return, but the telnet server is only sending cursor positioning sequences and not carriage returns. I have created an entry for you in our feature request database for SecureCRT to have the ability to log all data that comes to the screen - even when we are not receiving the carriage returns. We will contact you should a version of SecureCRT become available with that functionality. Thank you JJH |
#7
|
||||
|
||||
Quote:
Maureen |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|