Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2006, 07:20 PM
chadack's Avatar
chadack chadack is offline
Registered User
 
Join Date: Nov 2006
Location: San Diego
Posts: 13
Buffer Feature Suggestion

I think it would be enormously helpful for keeping track of important information if there was some way to permanently highlight text in the buffer.

For example: In the current arrangement when you put the cursor at a location and then hold down the left mouse button while you move through a line of text it becomes highlighted. But as soon as you do that operation again the original highlighted text stops being highlighted.

I would like to see the ability to highlight text and keep it highlighted. For example perhaps one could hold down both left and right mouse buttons together to make the text highlighting permanent.

Does anyone else think this would be useful?
Reply With Quote
  #2  
Old 12-12-2006, 12:52 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
I think the ability to highlight multiple words or strings could be very useful sometimes!

If you had the ability to highlight or change the color of certain strings, would this help?

Is the highlighting a purely visual cue, or would copying text also grab the selected text?
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #3  
Old 12-13-2006, 03:47 PM
mekanik mekanik is offline
Registered User
 
Join Date: Jul 2005
Posts: 46
Quote:
Originally Posted by chadack
Does anyone else think this would be useful?
Not really, seems like a memory hog waiting to happen (this would by my assumption anyways) as there would have to be something allocated to say that from charX to charZ, then highlight Y...Say for instance that you set the buffer to 32000 for all your sessions and you highlight 16000 lines in 5 tabs (5 * 16000, don't forget how many characters could be present or even blank space), seems like a potential memory hog IMHO...

/mekanik/
Reply With Quote
  #4  
Old 12-23-2006, 05:59 PM
chadack's Avatar
chadack chadack is offline
Registered User
 
Join Date: Nov 2006
Location: San Diego
Posts: 13
Remain Highlighted buffer feature

Michael, thanks for paying attention to my suggestion.

For the scenario I'm thinking of color is not important at all, and neither is the ability to copy the selected text [this should alleviate the potential memory hog issue (only the "first" selection would go to the "clipboard")].

All I want to do is [within already buffered text]: be able to "higlight" one area of text and then when I "highlight" another area, let the original highlighted text remain highlighted. You could call this "Remain Highlighted" mode, and have it as an option next to buffer size.

Here is a simple example of how I migh use it: I have a core router and an edge router on two seperate tabs. The T1 from the core to the edge is flapping. I want to find out: **1. How many times the T1 has flapped and **2. How long the latest flap was.

Currently I'll count the number of times I see down or up in the show log output. If I'm counting an I get interrupted, I'll have to go back and start counting again. To measure latest flap time, I'll just highlight the "down" line in the log and then find the "up" time and subtract. Again, if I get interrupted, I'll have to re-find the "up" line. So...if I had "Remain Highlighted" On...I would just highlight either all the "Up" or "Down" lines and them count them. If I get interrupted I can much more easily come back to what I was doing. Same holds for measuring the flap time. If I can higlight both the up and down lines in the log it makes it easier to figure the time of the flap both at the time I'm doing it, and if I need to come back to it later.

Let me know what you think.

Thanks
Reply With Quote
  #5  
Old 12-27-2006, 11:48 AM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
Hi chadack,

I've updated the feature request in our database with the information you provided - thanks for the additional details.

I think the scenario you describe would be a perfect application for a scripting solution.

If you could run a script that searched for keywords "Up" and "Down", and perhaps other strings, then perform some action based on what it finds (such as keep total counts of up, down, etc.) would this be helpful to you?
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #6  
Old 12-30-2006, 05:50 PM
chadack's Avatar
chadack chadack is offline
Registered User
 
Join Date: Nov 2006
Location: San Diego
Posts: 13
Database updated - Thanks

Mike,

Thanks for adding my feature request to the database and then updating it - I hope it gets implemented.

As for scripting: A script like the one you suggested would probably be useful to me, yes. I would like to write my own, but I'm not sure where to start. I took a C class several years ago so I've been exposed to the basics. Do most people who use SecureCRT script in Perl?

Thanks,
Greg
Reply With Quote
  #7  
Old 01-02-2007, 12:43 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
I'd guess the most common scripting language used by SecureCRT users is VBScript.

As for where to start, I'd recommend the SecureCRT Help / Contents tab / ActiveX Scripting / Creating Scripts chapter. It provides an overview of what's needed. In particular, you'll need an ActiveX Script engine. Since VBScript and JScript are commonly installed with Microsoft Internet Explorer, you probably already have these engines installed. Other ActiveX engines (such as for Perl and other languages) are available here:
http://www.activestate.com/
If you could show an example of some of the data, perhaps someone could write a short example showing:
  1. How many times the T1 has flapped and
  2. How long the latest flap was.
The number of flaps would be pretty simple. Determining how long the flap was might be pretty difficult programmatically, but the the first and last times of the flap could probably be shown without much trouble. It would probably require use of Crt.Screen.WaitForStrings and Crt.Screen.ReadString or Crt.Screen.Get2, all described in the SecureCRT Script Objects Reference.
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #8  
Old 01-09-2007, 01:41 PM
chadack's Avatar
chadack chadack is offline
Registered User
 
Join Date: Nov 2006
Location: San Diego
Posts: 13
Getting started...

Thanks for the direction on where to get started scripting.

Here is sample output from a T1 flapping - a script that could tell me how many seconds elapsed between the last controller X "down" and the last controller X "up" would be nice. In this case the controller X of interest is 0/1/0.

Jan 9 00:05:34 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/0/1, changed state to down (AIS detected)
Jan 9 00:05:36 CST: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to down
Jan 9 00:05:37 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to down
Jan 9 00:05:43 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/0/1, changed state to up
Jan 9 00:05:43 CST: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to up
Jan 9 00:05:44 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to up
Jan 9 00:52:56 CST: %CLEAR-5-COUNTERS: Clear counter on interface Serial0/0/1:0 by ...
Jan 9 01:37:41 CST: %LINK-3-UPDOWN: Interface Serial1/3, changed state to down
Jan 9 01:37:42 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/3, changed state to down
Jan 9 01:39:32 CST: %LINK-3-UPDOWN: Interface Serial1/3, changed state to up
Jan 9 01:39:35 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/3, changed state to up
Jan 9 14:18:02 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to down (AIS detected)
Jan 9 14:18:04 CST: %LINK-3-UPDOWN: Interface Serial0/1/0:0, changed state to down
Jan 9 14:18:05 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0:0, changed state to down
Jan 9 14:19:07 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to up
Jan 9 14:19:08 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to down (RAI detected)
Jan 9 14:19:19 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to up
Jan 9 14:19:21 CST: %LINK-3-UPDOWN: Interface Serial0/1/0:0, changed state to up
Jan 9 14:19:24 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0:0, changed state to up


And getting back the original point of this thread. Maybe you can see how being able to highlight two lines instead of just one would make picking out the two times to do the math easier.
Reply With Quote
  #9  
Old 01-11-2007, 04:11 PM
mekanik mekanik is offline
Registered User
 
Join Date: Jul 2005
Posts: 46
Quote:
Originally Posted by chadack
Thanks for the direction on where to get started scripting.

Here is sample output from a T1 flapping - a script that could tell me how many seconds elapsed between the last controller X "down" and the last controller X "up" would be nice. In this case the controller X of interest is 0/1/0.

Jan 9 00:05:34 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/0/1, changed state to down (AIS detected)
Jan 9 00:05:36 CST: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to down
Jan 9 00:05:37 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to down
Jan 9 00:05:43 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/0/1, changed state to up
Jan 9 00:05:43 CST: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to up
Jan 9 00:05:44 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to up
Jan 9 00:52:56 CST: %CLEAR-5-COUNTERS: Clear counter on interface Serial0/0/1:0 by ...
Jan 9 01:37:41 CST: %LINK-3-UPDOWN: Interface Serial1/3, changed state to down
Jan 9 01:37:42 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/3, changed state to down
Jan 9 01:39:32 CST: %LINK-3-UPDOWN: Interface Serial1/3, changed state to up
Jan 9 01:39:35 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/3, changed state to up
Jan 9 14:18:02 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to down (AIS detected)
Jan 9 14:18:04 CST: %LINK-3-UPDOWN: Interface Serial0/1/0:0, changed state to down
Jan 9 14:18:05 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0:0, changed state to down
Jan 9 14:19:07 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to up
Jan 9 14:19:08 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to down (RAI detected)
Jan 9 14:19:19 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to up
Jan 9 14:19:21 CST: %LINK-3-UPDOWN: Interface Serial0/1/0:0, changed state to up
Jan 9 14:19:24 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0:0, changed state to up


And getting back the original point of this thread. Maybe you can see how being able to highlight two lines instead of just one would make picking out the two times to do the math easier.
SNMP traps would assist you in situations like this. SNMP is your friend, especially with network gear...cheers,

--
mekanik
Reply With Quote
  #10  
Old 01-15-2007, 04:03 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
Thanks for following up with example output. I do see why the ability to select multiple lines would help. I think it should be possible to write a script which parses the data, but it's not as simple as I thought it would be. I was hoping a WaitForStrings would be sufficient, but in the example output you provided it looks like there is a serial 0/1/0 as well as a T1 0/1/0. We could hard code the data to wait for:
Crt.Screen.WaitForString "Controller T1 0/1/0"
then get the current line and continue parsing, but it would be less flexible than using a VBScript regular expression.

I'll see if I can write an example script the helps you meet your end goal of being able to more easily see the elapsed time between the last down/up events.
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #11  
Old 01-25-2007, 12:17 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
Does the following VBScript which uses regular expressions to help match patterns help you?

Code:
' Regular Expression Test
'
'Here is sample output from a T1 flapping - a script that could tell me how many seconds elapsed between the last controller X "down" and the last controller X "up" would be nice. In this case the controller X of interest is 0/1/0.

' Sample data:
'Jan 9 00:05:34 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/0/1, changed state to down (AIS detected)
'Jan 9 00:05:36 CST: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to down
'Jan 9 00:05:37 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to down
'Jan 9 00:05:43 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/0/1, changed state to up
'Jan 9 00:05:43 CST: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to up
'Jan 9 00:05:44 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to up
'Jan 9 00:52:56 CST: %CLEAR-5-COUNTERS: Clear counter on interface Serial0/0/1:0 by ...
'Jan 9 01:37:41 CST: %LINK-3-UPDOWN: Interface Serial1/3, changed state to down
'Jan 9 01:37:42 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/3, changed state to down
'Jan 9 01:39:32 CST: %LINK-3-UPDOWN: Interface Serial1/3, changed state to up
'Jan 9 01:39:35 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/3, changed state to up
'Jan 9 14:18:02 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to down (AIS detected)
'Jan 9 14:18:04 CST: %LINK-3-UPDOWN: Interface Serial0/1/0:0, changed state to down
'Jan 9 14:18:05 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0:0, changed state to down
'Jan 9 14:19:07 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to up
'Jan 9 14:19:08 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to down (RAI detected)
'Jan 9 14:19:19 CST: %CONTROLLER-5-UPDOWN: Controller T1 0/1/0, changed state to up
'Jan 9 14:19:21 CST: %LINK-3-UPDOWN: Interface Serial0/1/0:0, changed state to up
'Jan 9 14:19:24 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0:0, changed state to up

CONST SM_DATE_TIME      = 0
CONST SM_CONTROLLER_NUM = 1
CONST SM_CONNECT_TYPE   = 2
CONST SM_CONTROLLER_STR = 3
CONST SM_UPDOWN_STR = 4

Dim g_clipboard, g_map
Dim re, Matches, Match
Dim szController, szUpDown, szUp, szDown

Set g_clipboard = CreateObject("ScriptingTools.Clipboard")
Set g_map = CreateObject("Scripting.Dictionary")
g_map.RemoveAll

Set re = New RegExp
re.Global = TRUE
re.MultiLine = TRUE
re.IgnoreCase = TRUE

re.pattern = "^([A-Za-z]{3} \d{1,2} \d{2}:\d{2}:\d{2}) [A-Z]{1,5}: \%CONTROLLER-(\d{1,5})-UPDOWN: Controller (\S+) (\S+), changed state to (down|up)"

Set Matches = re.Execute(g_clipboard.Value)

szController = InputBox("Enter controller number to search for")
'msgbox Matches(0)

For each Match in Matches
    'MsgBox Match.Value & vblf & match.submatches(0)
    'MsgBox Match.Value & vblf & match.submatches(0)
    DateTime = Match.Submatches(SM_DATE_TIME)
    ControllerNum = Match.Submatches( SM_CONTROLLER_NUM )
    ConnectionType = Match.Submatches( SM_CONNECT_TYPE )
    ControllerStr = Match.Submatches( SM_CONTROLLER_STR )
    szUpDown = Match.Submatches( SM_UPDOWN_STR )

    If ControllerStr = szController Then
        If szUpDown = "up" Then
            szUp = Match
        Elseif szUpDown = "down" Then
            szDown = Match
        End If
    End If
     
Next

MsgBox "Date = " & DateTime & vbcr & _
    "Controller# = " & ControllerNum & vbcr & _
    "Connection Type = " & ConnectionType & vbcr & _
    "Controller String = " & ControllerStr & vbcr & _
    "Last Down = " & szDown & vbcr & _
    "Last Up = " & szUp & vbcr
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #12  
Old 01-28-2007, 04:15 PM
chadack's Avatar
chadack chadack is offline
Registered User
 
Join Date: Nov 2006
Location: San Diego
Posts: 13
Script test

Mike,

Thanks for the script. I'll see if I can test it out and let you know the results.

Greg
Reply With Quote
  #13  
Old 01-29-2007, 06:53 AM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
Sounds good. If you find that we're capturing the right data, we could calculate the elapsed time. There are VBScript functions that will help. The main goal for this first attempt was to make sure we caught the correct information.
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #14  
Old 02-13-2007, 07:23 PM
chadack's Avatar
chadack chadack is offline
Registered User
 
Join Date: Nov 2006
Location: San Diego
Posts: 13
How to...

I copied the text from the posting area that said "code" and pasted it into notepad.

I then saved the text as a file with extension .vbs

After that I logged into one of our routers and selected the log output showing a T1 flappping.

Next I went to the Script-->Run in SecureCRT and selected the .vbs file I had saved on the desktop.

The result was "VBScript runtime error Error: AciveX component can''t create object: 'ScriptingTolls.Clipboard' File C:\Documents and Settings\CHADACK\Desktop\flap.vbs Line: 37"

I also had previously installed IE7 to make sure ActiveX was installed on the computer - which is running XP Pro.

Any thoughts on what might be wrong?
Reply With Quote
  #15  
Old 02-14-2007, 11:48 AM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
Sorry about that, the code causing the problem depends on a script object which allows for interaction with the Windows clipboard. The example is using the Windows clipboard, but it might be simpler if data were read from a file. Would you rather select and copy the data from SecureCRT's window, or have the script read the data from a file?

It seems like reading data from a SecureCRT log file might make more sense and be a little easier to use and maintain. However, if you would prefer the clipboard, I'll see if I can consolidate some code to make the previously listed example work for you.
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
Reply

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 05:20 AM.