cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
53591
Views
6
Helpful
13
Replies

redirect results from sh command to text file

jomo frank
Level 1
Level 1

Hello expert,

I using putty software to access my router.

I would like to copy the result of SH POLICY-MAP INT to a text file for analysis.

The problem I encounter is the display is beyond the screen hence I have to press space bar for further display.

Is there a way I can execute the SH POLICY-MAP INT and redirect the output a text file or remove the more prompt found below the result page.

Regards

Jomo

1 Accepted Solution

Accepted Solutions

Try 'show policy-map int | redirect tftp://x.x.x.x/policy-map'

Regards,

Lei Tian

View solution in original post

13 Replies 13

Jon Marshall
Hall of Fame
Hall of Fame

rbglusers wrote:

Hello expert,

I using putty software to access my router.

I would like to copy the result of SH POLICY-MAP INT to a text file for analysis.

The problem I encounter is the display is beyond the screen hence I have to press space bar for further display.

Is there a way I can execute the SH POLICY-MAP INT and redirect the output a text file or remove the more prompt found below the result page.

Regards

Jomo

Jomo

In enable mode on your router -

router# term len 0   <--- this will mean there is no prompt and the full output is displayed

your command goes here

router# term len 24  <-- this just puts it back to normal

Jon

jomo frank
Level 1
Level 1

hello Jon,

I tried the command

>> router# term len 0   <--- this will mean there is no prompt and the full output is displayed.

The display is so large that i cannot capture  all the  info by scrolling and  paste  to  a text file .

Is there any method i could use to redirect output

Regards

rbglusers wrote:

hello Jon,

I tried the command

>> router# term len 0   <--- this will mean there is no prompt and the full output is displayed.

The display is so large that i cannot capture  all the  info by scrolling and  paste  to  a text file .

Is there any method i could use to redirect output

Regards

There are quite a few ways to do this but as you have the putty client simply use that to capture the text. See this link for details -

http://itknowledgeexchange.techtarget.com/network-technologies/how-to-capture-a-text-using-putty-client/

Jon

Also if you want to remove the "more" from a text file just do this in notepad......

Let's say you see this in your text file...

--More--         dot11 syslog

What you need to do is highlight from the beginning of the line to the d

include the spaces at the end of and begining of  --More--

Then right click on what you highlighted and choose copy

Now go to Edit----->Replace

and right click in the Find what box and choose paste

now just clcik once in the Replace with box and leave it blank

Now choose Replace All

and you should be good.

Mike

Hi Jomo,

Another option, you can do; but I think that is more complex than Jon's suggestion:)

3750_2#show policy-map int | redirect ?
  flash1:  Uniform Resource Locator
  flash:   Uniform Resource Locator
  ftp:     Uniform Resource Locator
  http:    Uniform Resource Locator
  https:   Uniform Resource Locator
  nvram:   Uniform Resource Locator
  rcp:     Uniform Resource Locator
  scp:     Uniform Resource Locator
  tftp:    Uniform Resource Locator

HTH,

Lei Tian

Hello Tan,

I am interested in your suggestion i attempted to redirect to a remote tftp server see command

router11#show policy-map int | redirect tftp:xxx.xxx.xxx.xxx

but when a check the tftp root direct location on my computer no file is copied maybe i am missing some step in the above command.

Regards

Jomo
  

Jon Marshall
Hall of Fame
Hall of Fame

Can you ping the tftp server ?

Does it have permissions to write the file ?

What tftp server is it ?

Jon

hello Jon,

Can you ping the tftp server ?

yes i test from within the router

Does it have permissions to write the file ?

unsure about the question.

What tftp server is it ?

Cisco tftp server 1.1

Regards

Jomo

Hi Jomo,

Do some quick test.

show policy-map int | red flash:show

copy flash:show tftp:

Are you able to copy the file to tftp srv?

Regards,

Lei Tian

hello Tian,

The test was sucessful . the file was transfer to tftp site

Regards

Jomo

Try 'show policy-map int | redirect tftp://x.x.x.x/policy-map'

Regards,

Lei Tian

Hello Tian,

Thanks a million , the command given in your post did the trick .

Keep up the good work.

Regards

Jomo

Hi,

I am also facing the same problem with the long output of the sh tech command.

Do you think that it's also possible to send the output file into the windows-server from which I am using Putty ? Because I am trying to get set the explorer address 10.x.x.103\C:\Users\chris\sh-tech without success.

I don't have any tftp server and the enterprise policy doesn't allow to install it.

Best regards and big thanks in advance !

Review Cisco Networking for a $25 gift card