Look what I found …

04 Jan, 2011

Interface status on SPLAT.

Posted by: admin In: SPLAT

Here’s a neat script for checking speed/duplex on your SPLAT nic’s.

#!/bin/bash

NICLIST=`ifconfig | egrep ‘^eth[0-9] ‘ | awk ‘{ print $1 }’`

for nics in $NICLIST
do
niclink=(`ethtool $nics | awk ‘/Duplex/ { duplex=$2 };
/Link detected/ { link=$3 }; /Speed/ { speed=$2 } END { print link ” ” speed ” ” duplex }’`)

if [ "${niclink[0]}” = ”yes” ]; then
speed=”${niclink[1]}”
duplex=”${niclink[2]}”
fi

printf ”%7s %4s %9s %5s\n” $nics ${niclink[0]} $speed $duplex

speed=”"
duplex=”"
done

And the ouput

eth0  yes  1000Mb/s  Full
eth1  yes  1000Mb/s  Full
eth2  yes  1000Mb/s  Full
eth3  yes  1000Mb/s  Full
eth4  yes  1000Mb/s  Full
eth5  yes  1000Mb/s  Full
eth6  yes  1000Mb/s  Full
eth7  yes  1000Mb/s  Full
eth8  yes  1000Mb/s  Full
eth9  yes  1000Mb/s  Full

No Responses to "Interface status on SPLAT."

Comment Form

About

This is my place. I can do whatever I want here.. Nice.. :-)
My idea is to publish some of the things I come across while searching for solutions that comes in handy in my line of work.
I hope someone out there will be interested..