The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to print script output to screen and file orahi001 UNIX for Dummies Questions & Answers 10 01-16-2009 01:47 AM
Terminal Output to a File ?? varungupta UNIX for Advanced & Expert Users 2 01-28-2008 03:24 PM
Putting screen output in a log file nsutti Shell Programming and Scripting 5 11-06-2007 05:47 PM
stuborn screen sessions sharanbr UNIX for Dummies Questions & Answers 0 10-23-2007 12:28 PM
terminal sessions and certs hu$h UNIX for Dummies Questions & Answers 2 05-16-2006 12:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-04-2008
tdelliott tdelliott is offline
Registered User
  
 

Join Date: Dec 2008
Location: PA
Posts: 3
Output terminal sessions to screen and log file

I would like to use a terminal session to ssh to switches and routers. I need to capture data while logged into switches to a file I can email for troubleshooting.

I use termial to log into Cisco switch, run the sh tech command, and then sent the output to cisco. Is there a way to run a script which will allow me to capture the sh tech output to a file. I am currently using the tcsh shell.

I am new to shell scripting so a good explaination would be greatly appreciated.
  #2 (permalink)  
Old 12-04-2008
juhanitali juhanitali is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 2
Quote:
Originally Posted by tdelliott View Post
I would like to use a terminal session to ssh to switches and routers. I need to capture data while logged into switches to a file I can email for troubleshooting.

I use termial to log into Cisco switch, run the sh tech command, and then sent the output to cisco. Is there a way to run a script which will allow me to capture the sh tech output to a file. I am currently using the tcsh shell.

I am new to shell scripting so a good explaination would be greatly appreciated.
script?

maybe
script logfile.log
ssh router.myhost
commands...
exit
exit (from script)

I have not used it much though.
  #3 (permalink)  
Old 12-04-2008
research3 research3 is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 88
sh run | tee tftp://192.168.1.1/tftpboot/sh.run-confg

you have to create the sh.run-confg file on the tftpboot folder with write access

sh run | tee /append ftp://userass@ftp.xxx.com/sh.run.com

appand (append to the given FILEs, do not overwrite

for the mail application you have to use tcl script
router#tclsh

Cisco IOS Scripting with Tcl - Cisco Systems
  #4 (permalink)  
Old 12-04-2008
tdelliott tdelliott is offline
Registered User
  
 

Join Date: Dec 2008
Location: PA
Posts: 3
Thanks

The script logfile.log worked fine. Thank you very much.
  #5 (permalink)  
Old 12-30-2008
Razer Razer is offline
Registered User
  
 

Join Date: Dec 2008
Location: Toronto - But hopping the globe
Posts: 1
Thank you!

I just wanted to send a personal thanks to Juhanitali for posting his "Script" solution. Took me 30 seconds to do a google search and I found your simple but power suggestion & solution. Has saved me HOURS.

Thanks for the post and extremely simple, yet POWERFUL solution.

Best regards,
Razer.
Toronto - Canada.
Sponsored Links
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0