10-18-2011 05:53 PM - edited 03-07-2019 02:54 AM
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.
Solved! Go to Solution.
10-19-2011 03:51 AM
is it only work with show run? but not other show command?
It will work as well.
10-18-2011 06:04 PM
Command: sh run | i red tftp://1.2.3.4/filename.txt
10-18-2011 06:59 PM
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,
10-18-2011 07:40 PM
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)
10-19-2011 03:51 AM
is it only work with show run? but not other show command?
It will work as well.
10-19-2011 09:52 AM
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?
10-19-2011 02:27 PM
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.
10-23-2011 10:01 PM
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?
10-23-2011 10:09 PM
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
10-25-2011 12:57 AM
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"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide