#!/bin/ksh # # # Tells you what blade/port you are using on a switch # #=============================================================================== #NIC should be something like: ce0, bge0, hme0, ... if (( $# )) then NICS=$1 else #loop on all the NICS NICS=$(ifconfig -a \ | awk -F: '/:/ {print $1}' \ | grep -v lo0 \ | grep -v ether \ | grep -v dman \ | sort -u) fi for NIC in $NICS do print -n "$NIC: " snoop -x0 -c1 -d $NIC multicast not broadcast greater 200 2> /dev/null \ | awk '{print $NF}'\ | grep -v http: \ | grep -v com \ | sed -e 's/\.//g' \ | sed -e 's/)//g' \ | sed -e 's/t//g' \ | grep \/ done exit 0