LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2006, 05:38 AM   #1
kharerohit
LQ Newbie
 
Registered: Feb 2006
Posts: 3

Rep: Reputation: 0
Need help in some scripting related to router information gathering.


I have written script for gathering information from the router shown as below:

#!/bin/sh

USERID=
PWD=
PWD1=
dir=`pwd`
ip=
intface=
DATE=`date +'%m%d'`
Time=`date +'%H%M'`
(echo "$USERID";\
echo "$PWD";\
echo "en";\
echo "$PWD1";\
echo "sh ip cache flow";\
echo "q";\
sleep 30 )| telnet $ip > $dir/info$ip$DATE$Time.txt

But through this I can run only single command or set of commands in same file at one logging into router.

Can anyone help how to get the result from the router for different commands in different file without logging again and again into router?
 
Old 03-17-2006, 11:22 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Chain all command using cmd1;cmd2;cmd3 format or store script on router itself
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gathering post breach information on linux xxx_anuj_xxx Linux - Security 3 11-12-2005 11:08 AM
Gathering computer system (linux )information in C minil Programming 2 03-09-2005 06:47 AM
Information Gathering xathras Linux - Networking 4 06-28-2004 02:23 PM
Information related to RAW partition RajaRC Red Hat 4 11-06-2003 11:18 PM
Information related to RAW partition RajaRC Linux - General 1 09-26-2003 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration