Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2013, 07:34 AM
Dalien51 Dalien51 is offline
Registered User
 
Join Date: Oct 2007
Posts: 8
Empty log file

I am running a script to Telnet onto various devices on my Network.

For some reason even though logging is enabled in my script, and the file is created, nothing is captured. A work colleague in I.T. suggested to me it was to do with the keyboard mapping and I tried every map option in turn and there still all blank.

Any idea why the log file is not capturing everyting displayed on the screen?

Many thanks.
Reply With Quote
  #2  
Old 03-06-2013, 08:49 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Dalien,

My guess would be that the devices don't send lines of data with a carriage return. They are likely painting the screen, and SecureCRT doesn't write a line of data until a carriage return is received.

You can determine this using a raw log. Here is how you can create a raw log:
  1. Before connecting with the session, select Raw Log Session from SecureCRT's File menu.
  2. In the Select Log File dialog, choose a folder and filename in which you would like the log text to be stored and click the Save button. At this point, if you open the File menu, you will notice that Raw Log Session now has a check-mark next to it; this indicates that raw logging is activated.
  3. Now connect to the remote machine and perform the actions which cause the reported problem to occur.
  4. Disconnect the session and select Raw Log Session from the File menu to turn off the raw log feature.
  5. Browse to the location of the raw log file see if it contains any carriage returns.
Would you post what you find from your test?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 03-06-2013, 09:20 AM
Dalien51 Dalien51 is offline
Registered User
 
Join Date: Oct 2007
Posts: 8
Works......but!

Yes now captures but unfortunately, it has squeezed all the text onto 1 line and has included what looks like printer characters......in short it is not how it appears on the screen.

Any suggestions?

Many thanks.
Reply With Quote
  #4  
Old 03-06-2013, 09:32 AM
Dalien51 Dalien51 is offline
Registered User
 
Join Date: Oct 2007
Posts: 8
If i tried copy and paste

What is the scripted send command for.......

ctrl+shift+a

copy

paste

ie crt.screen.send..........
Reply With Quote
  #5  
Old 03-06-2013, 09:53 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Dalien51,
Quote:
Yes now captures but unfortunately, it has squeezed all the text onto 1 line and has included what looks like printer characters......in short it is not how it appears on the screen.
The Raw log suggestion was not a solution. It was a way to see if the remote is sending carriage returns. It sounds like it is not. I have created a feature request to add an option to log all data sent to the terminal window. Should we add this feature in the future, we will post to this thread.

If you would like to be notified directly, please complete and submit the form at the following location:
Submit Feature Request
Quote:
What is the scripted send command for.......

ctrl+shift+a

copy

paste

ie crt.screen.send..........
The Send() method actually sends commands to the remote device to which you are connected. If you want to capture data, you would use the ReadString() method.

You could try and copy the data, or you could try and use a script.

Here is some additional information with script code examples:
Code:
' Select everything on the screen
crt.Screen.SendKeys "^+a"

' Copy everything to the clipboard
crt.Screen.SendKeys "^+c"

' Alternatively, we can access the Selection property to get at selected text
' without interfering with the clipboard"
strSelectedText = crt.Screen.Selection

' To "paste" data that is in the clipboard, we can do this one of two ways: 
' 1) simulate an Edit->Paste operation using SecureCRT's built-in Ctrl+Shift+V
'    shortcut:
crt.Screen.SendKeys "^+v"

' or 
' 2) just send the data in the clipboard as-is using the crt.Screen.Send() 
'    method:
crt.Screen.Send crt.Clipboard.Text
Does this help to answer your question?

If you want to learn more about scripting in relation to the SecureCRT scripting API, I would suggest taking a look at the scripting manual at the following location:
http://www.vandyke.com/support/tips/...ing/index.html
Chapter 4 discusses reading (capturing) data from remote machines.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730

Last edited by rtb; 03-06-2013 at 11:18 AM.
Reply With Quote
  #6  
Old 03-07-2013, 06:49 AM
Dalien51 Dalien51 is offline
Registered User
 
Join Date: Oct 2007
Posts: 8
Appending to log file

Is there a command to send the data within.........

crt.Clipboard.Text

to a specified log file?
Reply With Quote
  #7  
Old 03-07-2013, 09:06 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Dalien51,

To write to an existing file, you will need to use the file system object to obtain a handle to the file and write to it.

There are many examples of how to do this in the forums, but here is a simple example:
Code:
Set fso = CreateObject("Scripting.FileSystemObject")
' Constants used for reading and writing files.
Const ForReading   = 1
Const ForWriting   = 2
Const ForAppending = 8
Set objFile = fso.OpenTextFile("C:\temp\test.log", ForAppending, True)
objFile.WriteLine "This is a test."
' Close the log file
objFile.Close
Does this help?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #8  
Old 10-15-2019, 01:17 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,536
Quote:
Originally Posted by Dalien51 View Post
I am running a script to Telnet onto various devices on my Network.

For some reason even though logging is enabled in my script, and the file is created, nothing is captured. A work colleague in I.T. suggested to me it was to do with the keyboard mapping and I tried every map option in turn and there still all blank.

Any idea why the log file is not capturing everyting displayed on the screen?
The ability to log all data that comes to the screen, even when SecureCRT does not receive carriage returns, has been added to a pre-beta version of SecureCRT. Please email me at Maureen.Jett@vandyke.com if you would like to try it.

Maureen
Reply With Quote
Reply


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

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:15 AM.