UNIX scripts for router


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting UNIX scripts for router
# 1  
Old 01-10-2006
UNIX scripts for router

Hi,

I want to write a script in unix for my routers which will collect the output to a file..

how do i do that?

thanks in advance
# 2  
Old 01-10-2006
Could you give us exactly what you want?
# 3  
Old 01-10-2006
Hi,

please refer to the script below,

for i in `cat test.txt`
do
(echo "userid";
echo "password"

echo " sh ver"
grep System returned to ROM by error > error.txt

echo "lo";
sleep 5) | telnet $i
done

in test.txt ill define a couple of routers,
i need the script to run a issue a sh ver command on all those routers..till here it works fine.
now i want the list of routers that have the output mentioned in grep cmd in a seperate file..(error.txt)

m not very good at this but found it interesting,any inputs wud be of a great help.thanx for replying.

looking forward for a reply.
thnx
# 4  
Old 01-10-2006
You'd be much better off using Perl and Net::Telnet::Cisco to implement this....

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remote Unix printing to my WinXP works with no router. How can I make it work through my router?

I set up remote printing on a clients Unix server to my Windows XP USB printer. My USB printer is connected directly to my PC (no print server and no network input on printer). With my Win XP PC connected to my cable modem (without the router), i can do lp -dhp842c /etc/hosts and it prints. I... (7 Replies)
Discussion started by: jmhohne
7 Replies

2. UNIX for Dummies Questions & Answers

UNIX as ROUTER

dear all, hi... my name rian, i have some problem here, i'm trying to make router on UNIX machine, is there anyone know how to make it....... :confused: please let me know about the step.... thanks before.. cheers Rian (2 Replies)
Discussion started by: afriansyah
2 Replies

3. UNIX for Dummies Questions & Answers

Using UNIX as a router

Is there a way that i can create some start up disks for a computer with no hard drive to become a router? I know there are types of Linux OS's that can do it but i dont know which ones they are or where i can get them from. I am very new to the UNIX/Linux thing so I thank you for any help. (2 Replies)
Discussion started by: e980238
2 Replies

4. IP Networking

Software Router for Unix

Dear Users: I'm trying to find a software based Unix Router. I only want to bridge two subnets, and I'm not trying to share an internet connection. Ultimately, I'm looking for the sourcecode so that I can compile it for Mac OS X, which is the machine that the we want the router to run on. I'd... (4 Replies)
Discussion started by: emulator
4 Replies
Login or Register to Ask a Question