cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
39699
Views
10
Helpful
9
Replies

Copy current show run result into text file

Teoh Chee Hin
Level 1
Level 1

Dear all,

Anyone know that how to copy to the current show command into a text file?

Example, copy running-config tftp://192.168.0.1/config.cfg
or
copy flash:xxxx tftp://192.168.0.1/

I have no problem on copy configuration, IOS, etc.

But how to copy the current show run, show inventory, show proc cpu, show tech, into a text file?

Is it we need to create a directory, then issue all this show command, show xxx, show xxx, then capture all this result and save it into text file.

I understand that teraterm or hyper terminal can capture, but i want do it in some script or batch file.

help.

1 Accepted Solution

Accepted Solutions

is it only work with show run? but not other show command?

It will work as well.

View solution in original post

9 Replies 9

Leo Laohoo
Hall of Fame
Hall of Fame

Command:  sh run | i red tftp://1.2.3.4/filename.txt

nkarpysh
Cisco Employee
Cisco Employee

You can build EEM script and copy paritcular commands to the location you need. You can instruct it to start at particular trigger or the time and do multiple commands. Read more about EEM here:

http://www.cisco.com/en/US/products/ps6815/products_ios_protocol_group_home.html

Nik,

HTH,
Niko

Teoh Chee Hin
Level 1
Level 1

Thanks u guy.

I tried, however, for show run | i red tftp://1.2.3.4/filename.txt

is it show run | redirect ?

tftp:

ftp:

scp:

etc...

if i used show run | redirect ..... is worked.

however, i want show dot11 asso all-client, or show proc cpu to capture all this info into a text file, it seemed impossible?

is it only work with show run? but not other show command?

regarding EEM, i not able to use it, as this command i apply to cisco1242N

this is version 12.4(23c)

is it only work with show run? but not other show command?

It will work as well.

Dear Leolaohoo,

Thank! it work

However is not

Command:  sh run | i red tftp://1.2.3.4/filename.txt

but is

show run | redirect tftp://1.2.3.4/filename.txt

besides, can i know how to add into this filename.txt ?

example

for first show run | redirect tftp://1.2.3.4/filename.txt

then, the second line, "show tech | redirect tftp://1.2.3.4/filename.txt"

but i want this show tech result to be append into the same filename.txt, just adding the result, not overwrite or new filename, how to do that?

but i want this show tech result to be append into the same filename.txt, just adding the result, not overwrite or new filename, how to do that?

1.  First you do a "sh run | redirect tftp://1.2.3.4/MYTEXTFILE.TXT";

2.  You want to add the next ouput to the same file?  Use this command "sh tech | append tftp://1.2.3.4/MYTEXTFILE.TXT".

By the way, when you do a "sh tech", this already includes the "sh run" command.

Leolaohoo,

thank.

i tried, however the append command is not support for tftp, only ftp and nvram.

anyway to append inside this tftp ? or

my second alternative solution is add a new line in the text, eg:

mytextfile.txt

________________

line 0 testing_script

line 1 (only start the output for show xxx command)

how?

What appliance are you using?  I'm using a Cisco 1140 and running 12.4(25d)JA and I can see the "append" option.

ap#sh tech | append ?

ftp:    Uniform Resource Locator

nvram:  Uniform Resource Locator

Yes, same.

Thank, i understand that there is "append", however this append just for nvram and ftp, NOT for TFTP.

Is ok, may i know that how to append, with the first line command, eg as below:

mytextfile.txt

line 0 "this is my test result"

line 1 "start all the show xxx result here"