show commands in cisco ios output to tftp ?

in Off-Topic
Is there a way to run certain commands, such as 'show tech-support' and get the output into a text file tftp'ed rather than getting the output on a screen ?
My own knowledge base made public: http://open902.com 

Comments
-
Bl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
Is there a way to run certain commands, such as 'show tech-support' and get the output into a text file tftp'ed rather than getting the output on a screen ?
It's probably going to be a tcl script:
Re: How to write output of a tcl script to a file?
expect script writing partial output to the file - The Tcl programming language
Cisco IOS Scripting with Tcl - Cisco Systems -
broc Member Posts: 167
You can do it without a script, just use the following command:
show <command> | redirect tftp:[[//location]/directory]/filename
and to add the output to the file:
show <command> | append tftp:[[//location]/directory]/filename
Obviously, it works for tftp, ftp, scp, etc..."Not everything that counts can be counted, and not everything that can be counted counts.” -
Bl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
You can do it without a script, just use the following command:
show <command> | redirect tftp:[[//location]/directory]/filename
and to add the output to the file:
show <command> | append tftp:[[//location]/directory]/filename
Obviously, it works for tftp, ftp, scp, etc...
Wow I did not know you could do that. Awesome. -
networker050184 Mod Posts: 11,962 Mod
I just use the log feature in PuTTY/SecureCRT to log session output.An expert is a man who has made all the mistakes which can be made. -
jibbajabba Member Posts: 4,317 ■■■■■■■■□□
networker050184 wrote: »I just use the log feature in PuTTY/SecureCRT to log session output.
Crashed one me .. I suppose 'show tech-support' had too many lines or something .. same with xshellYou can do it without a script, just use the following command:
show <command> | redirect tftp:[[//location]/directory]/filename
and to add the output to the file:
show <command> | append tftp:[[//location]/directory]/filename
Obviously, it works for tftp, ftp, scp, etc...
Cheers
I did end up doing something different already though. We have a Linux server which has access to the cisco switches so I used the Linux command 'script' to get everything logged ..
The redirect bit gave meTFTP: error code 4 received - Missing modeMy own knowledge base made public: http://open902.com -
networker050184 Mod Posts: 11,962 Mod
Crashed one me .. I suppose 'show tech-support' had too many lines or something .. same with xshell
Really? I use it for show tech all the time and never had an issue.An expert is a man who has made all the mistakes which can be made. -
jibbajabba Member Posts: 4,317 ■■■■■■■■□□
networker050184 wrote: »Really? I use it for show tech all the time and never had an issue.
Maybe just "one of those things"My own knowledge base made public: http://open902.com -
broc Member Posts: 167
Cheers
I did end up doing something different already though. We have a Linux server which has access to the cisco switches so I used the Linux command 'script' to get everything logged ..
The redirect bit gave me
Quote:
TFTP: error code 4 received - Missing mode
hmm, error code 4 "I think" this is illegal operation but that doesn't help much
I generally use scp personally or good old copy & paste!"Not everything that counts can be counted, and not everything that can be counted counts.”