For When You Can't Have The Real Thing
[ start | index | login ]
start > switchwalk


Created by dave. Last edited by dave, 8 years and 360 days ago. Viewed 2,095 times. #1
[edit] [rdf]

Example switchwalk script. This script takes the passed MAC address then feeds it to for each switch.

I wrap the "like-typed" switches together in a for-&-wait loop because otherwise you have to sit through each switch sequentially, which can get long.



if [ -z "$1" ] ; then echo target? exit 1 fi echo Core $FINDMAC -c mycomm sa4-39 $1 & $FINDMAC -c mycomm sa4-38 $1 & wait echo Edge for i in sa1-41 sa2-39 sa3-37 sa3-41 sa4-42 sa5-41 sa6-41 sa7-41 sb5-41; do $FINDMAC -c mycomm $i $1 & done | sort | uniq wait echo Front for i in sa4-16 sa4-19 sa4-20 ; do $FINDMAC -c mycomm $i $1 & done | sort | uniq wait

Example output:

$ switchwalk 00:1C:23:65:B9:20
sa4-38: port 6(ae5.0)
sa4-39: port 528(ge-0/0/15.0)
sa1-41: port 560(ge-0/0/47.0)
sa2-39: port 560
sa3-37: port 21(ae20.0)
sa3-41: port 560(ge-0/0/47.0)
sa4-42: port 27(Slot0/27)
sa5-41: port 560(ge-0/0/47.0)
sa6-41: port 560(ge-0/0/47.0)
sa7-41: port 560(ge-0/0/47.0)
sb5-41: port 1(ae0.0)
sa4-16: port 24(g24)
sa4-19: port 23(g23)
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt