grep eri setting via ndd

Monday, August 30, 2010 at 10:01 PM
#! /bin/ksh
# erigrep version 0.0.1 - grep eri settings via ndd.
# o_|/ borked eri drivers!
# June 5 2003 Sam Nelson
# As usual, not clever or efficient, but quick, dirty and effective.
# tested on Solaris 8 and 9.

#Set a tmpfile
TMPFILE=erigrep.txt

echo "Running erigrep script........"

# Got root?
#
Check_ID()
{
ID=$(/usr/ucb/whoami)
if [ $ID != "root" ]; then
echo "$ID, you must be root to run this script."
exit 1
fi
}
Check_ID

# Get uname (useful!)
echo "erigrep report for host:" >$TMPFILE
/usr/bin/uname -a >>$TMPFILE 2>&1

# Get some basic stuff:
echo "netstat -s -P tcp" >>$TMPFILE 2>&1
netstat -s -P tcp >>$TMPFILE 2>&1
echo "netstat -s -P udp" >>$TMPFILE 2>&1
netstat -s -P udp >>$TMPFILE 2>&1

###get eri stuff

echo "eri settings" >>$TMPFILE 2>&1

echo "ndd -get /dev/eri transceiver_inuse" >>$TMPFILE 2>&1
ndd -get /dev/eri transceiver_inuse >>$TMPFILE 2>&1

echo "ndd -get /dev/eri link_status" >>$TMPFILE 2>&1
ndd -get /dev/eri link_status >>$TMPFILE 2>&1

echo "ndd -get /dev/eri link_speed" >>$TMPFILE 2>&1
ndd -get /dev/eri link_speed >>$TMPFILE 2>&1

echo "ndd -get /dev/eri link_mode" >>$TMPFILE 2>&1
ndd -get /dev/eri link_mode >>$TMPFILE 2>&1

echo "ndd -get /dev/eri ipg1" >>$TMPFILE 2>&1
ndd -get /dev/eri ipg1 >>$TMPFILE 2>&1

echo "ndd -get /dev/eri ipg2" >>$TMPFILE 2>&1
ndd -get /dev/eri ipg2 >>$TMPFILE 2>&1

echo "ndd -get /dev/eri use_int_xcvr" >>$TMPFILE 2>&1
ndd -get /dev/eri use_int_xcvr >>$TMPFILE 2>&1

echo "ndd -get /dev/eri pace_size" >>$TMPFILE 2>&1
ndd -get /dev/eri pace_size >>$TMPFILE 2>&1

echo "ndd -get /dev/eri adv_autoneg_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri adv_autoneg_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri adv_100T4_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri adv_100T4_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri adv_100fdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri adv_100fdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri adv_100hdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri adv_100hdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri 10fdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri 10fdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri 10hdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri 10hdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lp_autoneg_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri lp_autoneg_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lp_100T4_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri lp_100T4_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lp_100fdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri lp_100fdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lp_100hdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri lp_100hdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lp_10fdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri lp_10fdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lp_10hdx_cap" >>$TMPFILE 2>&1
ndd -get /dev/eri lp_10hdx_cap >>$TMPFILE 2>&1

echo "ndd -get /dev/eri instance" >>$TMPFILE 2>&1
ndd -get /dev/eri instance >>$TMPFILE 2>&1

echo "ndd -get /dev/eri lance_mode" >>$TMPFILE 2>&1
ndd -get /dev/eri lance_mode >>$TMPFILE 2>&1

echo "ndd -get /dev/eri ipg0" >>$TMPFILE 2>&1
ndd -get /dev/eri ipg0 >>$TMPFILE 2>&1

echo "ndd -get /dev/eri intr_blank_time" >>$TMPFILE 2>&1
ndd -get /dev/eri intr_blank_time >>$TMPFILE 2>&1

echo "ndd -get /dev/eri intr_blank_packets" >>$TMPFILE 2>&1
ndd -get /dev/eri intr_blank_packets >>$TMPFILE 2>&1

# hot kstat action:
echo "kstat eri output" >>$TMPFILE 2>&1
kstat eri >>$TMPFILE 2>&1

echo "OK script finished" >>$TMPFILE 2>&1

echo Check current directory for erigrep.txt file!

0 comments

Post a Comment

Solaris | Powered by Blogger | Entries (RSS) | Comments (RSS) | Designed by MB Web Design | XML Coded By Cahayabiru.com