• Support
  • Articles
  • Resources
  • Products

Dealing with " -- More -- " or Equivalent Strings.

Moderator: boris

14 postsPage 1 of 1

MC Slayer
Newbie

Posts:
4
Joined: Tue Jun 28, 2011 1:18 pm
by MC Slayer » Sat Jul 16, 2011 6:50 am
Hello all,

I'm trying to write a script for logging "show run" on a number of different routers. Is there a command to send a space when it displays " -- More -- " or any equivalent string? Or should I know what all the routers are going to display? Also, if this is not possible, can I just type a command on the router to make it display the full configuration without stopping?

Thank you very much.
Trevor
Guru

Posts:
483
Joined: Wed Jul 26, 2006 8:47 am
by Trevor » Sun Jul 17, 2011 12:08 pm
Hi MC Slayer,
Something like this to send space when " -- More -- " received.

Code: Select all

  1.  
  2. timeout = 5
  3. wait " -- More -- " "what ever comes at the end e.g. command prompt"
  4. if result = 1 send ' '
  5. if result = 0 messagebox 'did not get expected response' 'Error'    ; timeout
  6.  


Also, if this is not possible, can I just type a command on the router to make it display the full configuration without stopping?

That depends on your router. Better to ask that question in the particular router forum.

Regards
Trevor
MC Slayer
Newbie

Posts:
4
Joined: Tue Jun 28, 2011 1:18 pm
by MC Slayer » Mon Jul 18, 2011 10:44 am
What I was looking for is that maybe there is some kind of command that waits for this pause and is embedded in the Macro Language. I was pretty sure there isn't I was just making sure. and the way you're doing it is the same way I am at the moment.

However for future reference you can send the command :

terminal length 0 ; for cisco routers
set length 0 ; for cisco switches.

to skip this pause and make it display the whole configuration.

Thanks anyways Trevor, you were really helpful :)
ccaceresuy6
Newbie

Posts:
5
Joined: Fri Jul 22, 2011 7:36 pm
by ccaceresuy6 » Fri Jul 22, 2011 11:16 pm
I would like to interact with you about this topic
aleksashka1987
Newbie

Posts:
7
Joined: Sun May 08, 2011 10:50 am
by aleksashka1987 » Fri Nov 04, 2011 12:41 pm
I have another question about dealing with " --More-- " string.
I have a default logging in TeraTerm and all my sessions are logged. And those " --More-- " are quite annoying, especially if I know, that PuTTY removes those " --More-- " automatically.

Is it possible to do the same on TeraTerm? It would be very nice :-), because often "terminal length 0" is not very convenient.
aleksashka1987
Newbie

Posts:
7
Joined: Sun May 08, 2011 10:50 am
by aleksashka1987 » Fri Nov 04, 2011 1:19 pm
BTW, even though on screen I see one space before "--More--" and one space after:

Code: Select all

  1. " --More-- "
(without quotes).

In the log-file it is actually written as one space before and 9 spaces after "--More--":

Code: Select all

  1. " --More--         "

I checked how the log-file is populated: one space, "--More--" and one space after are written as soon as it is displayed.
After that, when I press "Enter" to show one more line of the configuration, TeraTerm sends "\r" (seen in Wireshark) and receives the following text in Telnet-packet:

Code: Select all

  1. \b\b\b\b\b\b\b\b\b        \b\b\b\b\b\b\b\b\bip nat inside source static tcp 192.168.1.3 2007 interface FastEthernet0/0.115 2307\r\n

The line above is presented as it looks like in Wireshark (and it has 8 spaces between consecutive "\b", which are written in the log as well), but if I copy this line and paste it in the text editor, then it becomes like this:

Code: Select all

  1. \x08\x08\x08\x08\x08\x08\x08\x08\x08        \x08\x08\x08\x08\x08\x08\x08\x08\x08ip nat inside source static tcp 192.168.1.3 2007 interface FastEthernet0/0.115 2307\x0d\x0a

and the next line in Telnet-packet is again " --More-- " (with one space from each side).

So I hope that it will be possible to add an exception to the logging on any " --More-- " or "\b\b\b\b\b\b\b\b\b        \b\b\b\b\b\b\b\b\b" occurrences, and it will not remove any "needed" spaces. E.g. in the line below three spaces before "network" are needed to improve readability of the configuration:

Code: Select all

  1. \b\b\b\b\b\b\b\b\b        \b\b\b\b\b\b\b\b\b   network 192.168.1.0 255.255.255.0\r\n

Hope we will receive a solution :smile:
crumpuppet
Newbie

Posts:
2
Joined: Wed Nov 30, 2011 12:22 pm
by crumpuppet » Wed Nov 30, 2011 1:16 pm
I encountered this recently, and found it to be easier to set terminal length to 0 before executing "show run". However, I am having trouble getting the output saved to a file.

I tried using recvln, but it only captures the last few lines shown on the screen. So then I tried using logopen and logclose which looked promising, but it only captures about 10KB of data and then cuts off. It does successfully write stuff to the output file, but it seems the buffer is too small. Whether this is LogMeTT or TeraTerm's buffer, I don't know.

The "show run" command runs successfully though, I can see it running through the settings, but it gets stuck about 3/4 through. It sits for a few seconds, eventually finishes and my macro completes cleanly. But when I look at the output file, it is truncated where the "show run" command got stuck.

Anyone have any idea why this is?
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1596
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Wed Nov 30, 2011 1:55 pm
Whether this is LogMeTT or TeraTerm's buffer, I don't know.

LogMeTT does not participate in Macro execution. It just saves macro into temporary file and passes it to TeraTerm.
Thanks.
Best regards,
Boris
crumpuppet
Newbie

Posts:
2
Joined: Wed Nov 30, 2011 12:22 pm
by crumpuppet » Wed Nov 30, 2011 2:06 pm
boris wrote:
Whether this is LogMeTT or TeraTerm's buffer, I don't know.

LogMeTT does not participate in Macro execution. It just saves macro into temporary file and passes it to TeraTerm.


Ah OK, makes sense. So would you say logopen the best way to save a big output like that to file? All in all I'm guessing the output is going to be between 15KB and 20KB. It is strange that it sort of works, but not quite. No failures anywhere, just truncated output.

thanks Boris :smile:
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1596
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Wed Nov 30, 2011 3:53 pm
Sorry, I cannot comment on that. I rarely use log files. Hopefully somebody from Tera Term developers or other users will reply.
Thanks.
Best regards,
Boris
aleksashka1987
Newbie

Posts:
7
Joined: Sun May 08, 2011 10:50 am
by aleksashka1987 » Fri Dec 02, 2011 3:48 am
crumpuppet wrote:I am having trouble getting the output saved to a file.
I tried using recvln, but it only captures the last few lines shown on the screen.

Did you try using AutoLogging?
I did not try it on very big configurations from routers, but when I did "cat" on linux machine it worked fine on 189 KB output (189 KB of text-output from just one "cat" command – 1289 lines of text) :-), and total size of log-file from that session is 1.05 MB.

Code: Select all

  1. ; without transfer dialog flag for Log (on/off)
  2. LogHideDialog=on
  3. ; Default Log file name. You can specify strftime format to here.
  4. LogDefaultName=%Y%m%d-%H%M%S_%a_&h_log.txt
  5. ; Default path to save the log file.
  6. LogDefaultPath="c:\Temp\TeraTerm\"
  7. ; Auto start logging with default log file name.
  8. LogAutoStart=on 


BTW, I checked PuTTY and I found out that it does not remove " -- More -- " from log-files... But anyway, Boris, is it possible to add one line to teraterm.ini like "RemoveMoreFromLog=On"?
Or could you please tell me where should I ask for this feature?
Thank you
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1596
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Fri Dec 02, 2011 8:21 am
But anyway, Boris, is it possible to add one line to teraterm.ini like "RemoveMoreFromLog=On"?
Or could you please tell me where should I ask for this feature?

I am not part of Tera Term design team lead by Yutaka Hirata, but Yutaka himself and other designers are regularly attending these forums and may reply to your post. Additionally you can request this new feature in our Tera Term suggestions forum here viewforum.php?f=6
Thanks.
Best regards,
Boris
aleksashka1987
Newbie

Posts:
7
Joined: Sun May 08, 2011 10:50 am
by aleksashka1987 » Fri Dec 02, 2011 8:57 am
boris wrote:Additionally you can request this new feature in our Tera Term suggestions forum here viewforum.php?f=6
Thank you, I have posted a feature request and a poll to check if this feature is needed here.
Mokan
Newbie

Posts:
4
Joined: Mon Jun 19, 2017 2:14 am
by Mokan » Mon Jun 19, 2017 3:15 am
aleksashka1987 wrote:I have another question about dealing with " --More-- " string.
I have a default logging in TeraTerm and all my sessions are logged. And those " --More-- " are quite annoying, especially if I know, that PuTTY removes those " --More-- " automatically.

Is it possible to do the same on TeraTerm? It would be very nice :-), because often "terminal length 0" is not very convenient.


Hi maybe you should try this as your fist command

Code: Select all

  1.  
  2. wait CommandPrompt
  3. flushrecv
  4. sendln 'No page'
  5.  


This will automatically helps you to avoid "---More---" string.
Display posts from previous:
Sort by:

14 postsPage 1 of 1

Users browsing this forum: No registered users
cron