MoshiachNow
IS-IT--Management
HI,
Just wanted to have all IP parameters for all interfaces in one window,including the Interface card type and the current selected speed :
Int IP_address Mask DNS Gateway Domain Speed Selected Type
--- ---------- ---- --- ------- ------ -------------- ------
en0 10.4.2.12 10.4.26.1 cil.co.com 100_Full_Duplex 100BT
en1 10.4.2.12 10.4.26.1 cil.co.com none 100BT
en2 10.4.27.77 255.255.254.0 10.4.2.12 10.4.26.1 cil.co.com 100_Full_Duplex 100BT
===================================
The script that does it is below :
===================================
#!/bin/ksh
# Written on 1/7/03
# Updated April 17, 2005
# Version 1.7
# The script displays IP settings on all ent interfaces
printf "%-4s %-15s %-15s %-14s %-14s %-21s %-20s %-8s\n" "Int" "IP_address" "Mask" "DNS" "Gateway" "Domain" "Speed Selected" "Type"
printf "%-4s %-15s %-15s %-14s %-14s %-21s %-20s %-8s\n" "---" "----------" "----" "---" "-------" "------" "--------------" "------"
for EN in `lsdev -Cs pci| awk '/ent/ { print $1 }'|cut -c 1,2,4`;do
mktcpip -S $EN 2>&1|awk -F: '$0 !~ /host/ {printf ("%-4s %-15s %-15s %-14s %-14s %-22s",$4,$2,$3,$5,$7,$6 )}'
ENT=`echo $EN|cut -c 3`
SPEED=`lsattr -El ent$ENT | grep -i speed|awk '{print $2}'`
if [[ -z $SPEED ]] ;then
SPEED="none"
fi
lscfg -v -l ent$ENT|grep -iE "gigabit|10/100/1000" >/dev/null
if [[ $? = 0 ]] ;then
DESCRIPTION=GIGABIT
else
DESCRIPTION=100BT
fi
printf "%-20s %-20s \n" $SPEED $DESCRIPTION
done
exit
Long live king Moshiach !
Just wanted to have all IP parameters for all interfaces in one window,including the Interface card type and the current selected speed :
Int IP_address Mask DNS Gateway Domain Speed Selected Type
--- ---------- ---- --- ------- ------ -------------- ------
en0 10.4.2.12 10.4.26.1 cil.co.com 100_Full_Duplex 100BT
en1 10.4.2.12 10.4.26.1 cil.co.com none 100BT
en2 10.4.27.77 255.255.254.0 10.4.2.12 10.4.26.1 cil.co.com 100_Full_Duplex 100BT
===================================
The script that does it is below :
===================================
#!/bin/ksh
# Written on 1/7/03
# Updated April 17, 2005
# Version 1.7
# The script displays IP settings on all ent interfaces
printf "%-4s %-15s %-15s %-14s %-14s %-21s %-20s %-8s\n" "Int" "IP_address" "Mask" "DNS" "Gateway" "Domain" "Speed Selected" "Type"
printf "%-4s %-15s %-15s %-14s %-14s %-21s %-20s %-8s\n" "---" "----------" "----" "---" "-------" "------" "--------------" "------"
for EN in `lsdev -Cs pci| awk '/ent/ { print $1 }'|cut -c 1,2,4`;do
mktcpip -S $EN 2>&1|awk -F: '$0 !~ /host/ {printf ("%-4s %-15s %-15s %-14s %-14s %-22s",$4,$2,$3,$5,$7,$6 )}'
ENT=`echo $EN|cut -c 3`
SPEED=`lsattr -El ent$ENT | grep -i speed|awk '{print $2}'`
if [[ -z $SPEED ]] ;then
SPEED="none"
fi
lscfg -v -l ent$ENT|grep -iE "gigabit|10/100/1000" >/dev/null
if [[ $? = 0 ]] ;then
DESCRIPTION=GIGABIT
else
DESCRIPTION=100BT
fi
printf "%-20s %-20s \n" $SPEED $DESCRIPTION
done
exit
Long live king Moshiach !