show commands in cisco ios output to tftp ?

jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
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 :p

Comments

  • Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    Gomjaba wrote: »
    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
  • brocbroc 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.”
  • Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    broc wrote: »
    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.
  • networker050184networker050184 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.
  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    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 xshell
    broc wrote: »
    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...


    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
    TFTP: error code 4 received - Missing mode
    My own knowledge base made public: http://open902.com :p
  • networker050184networker050184 Mod Posts: 11,962 Mod
    Gomjaba wrote: »
    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.
  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    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 :p
  • brocbroc 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.”
Sign In or Register to comment.