Here is a short script to show a "tree" view of Etherchannel devices on AIX. It shows the devices that make up the etherchannel, including the backup device if there is one:
#!/usr/bin/ksh
for ec in `lsdev | grep ^ent | grep -i etherchannel | awk '{print $1}'`; do
echo "$ec - Etherchannel device";
for adapter in `lsattr -El $ec -a adapter_names | awk '{print $2}' | tr "," " "`; do
echo " `lscfg -l $adapter`"
done
backup=`lsattr -El $ec -a backup_adapter 2>/dev/null | awk '{print $2}'`
[ "$backup" != "" -a "$backup" != "NONE" ] && echo "**`lscfg -l $backup` ** Backup Adapter"
echo
done
for ec in `lsdev | grep ^ent | grep -i etherchannel | awk '{print $1}'`; do
echo "$ec - Etherchannel device";
for adapter in `lsattr -El $ec -a adapter_names | awk '{print $2}' | tr "," " "`; do
echo " `lscfg -l $adapter`"
done
backup=`lsattr -El $ec -a backup_adapter 2>/dev/null | awk '{print $2}'`
[ "$backup" != "" -a "$backup" != "NONE" ] && echo "**`lscfg -l $backup` ** Backup Adapter"
echo
done
Very useful for me ATM, thx for posting!
ReplyDeleteDaniel