[mrtg] Re: show ports for Cisco
Steve Rowe
steve.rowe at sheridanc.on.ca
Mon Nov 19 16:33:37 MET 2001
I use a combination of shell and expect scripts to grab this info from
4006s and 6509s to a CSV file. servfarmlist would contain a list of
switches to be polled.
Steve
#!/bin/sh
cd ~/scripts
for host in `cat servfarmlist`
do
servdist.exp $host|tr -s " "|tr " " ","|tr -d "^M" > sf,$host
done
grep '/' sf,*|grep -v '15/1'|tr -d ":"|sort -t , -k 4 > farmdb.txt
rm sf,*
#!/usr/local/bin/expect
if {[llength $argv] != 1} {exit} else {spawn telnet $argv}
set timeout 5
expect "assword: " {send "XXXXXX\r"}
expect ">" {send "set length 0\r"}
expect ">" {send "sh po sta\r"}
expect ">" {send "exit\r"}
At 11/19/01 - 06:25 AM, Mike Singleton wrote:
>Do you have a script that will parse the output of 'show ports' on a 5509
>Cisco switch? thnx.
>
>
>
>
>===
>Mike Singleton CCNA, CNE, MCSE
>Network Analyst
>(253) 272-1916 x1259
>(253) 405-1968 (cellular)
>msingle at davita.com
>
>DaVita Inc.
>
>
>--
>Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
>Archive http://www.ee.ethz.ch/~slist/mrtg
>FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
>WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
-
/ __|______| _ \___________________________________________________________
\__ \ | / Network Analyst - Data Systems Group
____/TEVE |_|_\OWE Information Technology - Sheridan College
Trafalgar Campus - Oakville, ON, Canada
steve.rowe at sheridanc.on.ca ./\.
Phone: 905-845-9430 x2032 ICQ: _|\| |/|_
http://numb.sheridanc.on.ca 14509731 \ /
_________________________________________________________________>______<__
Make something idiot proof and someone will make a better idiot. /
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list