Missing dladm command for Solaris 9

I am doing more frustrating Solaris work and stumbled across this little gem. A simple nawk script that produces the same output as the dladm show-dev command implemented in Solaris 10.

Just paste it into a file, chmod it and there you go.

kstat -p | nawk '/duplex/ || /speed/ { split($1,Array,":") ; Dev=Array[3]
 } /link_duplex/ && $2=="2" { Duplex[Dev]="full" } /link_duplex/ && $2=="1"
 { Duplex[Dev]="half" } /link_speed/ { if ( Duplex[Dev] == "" ) 
Duplex[Dev]="unknown" ; Speed[Dev]=$2 ; print Dev "tlink: unknowntspeed:
 " Speed[Dev] "tMbittduplex: " Duplex[Dev] }'

 

ce0 link: unknown speed: 100 Mbit duplex: full
ce1 link: unknown speed: 1000 Mbit duplex: full
ce2 link: unknown speed: 1000 Mbit duplex: full
ce3 link: unknown speed: 1000 Mbit duplex: full
ce4 link: unknown speed: 0 Mbit duplex: unknown
ce5 link: unknown speed: 0 Mbit duplex: unknown

http://netmgt.blogspot.com/2010/04/solaris-9-missing-dladm-show-dev.html

Leave a Reply

Your email address will not be published. Required fields are marked *