Thursday, 18 April 2013

Script to show Etherchannel "Tree" view on AIX


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:

  
Here is the script:
#!/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

2 comments:

  1. Very useful for me ATM, thx for posting!

    Daniel

    ReplyDelete
  2. Dear, I like your blog very much, I can get many useful information. Hope that we can communicate with each other. By the way, have you ever used resize server 2003 boot partition ? Unfortunately I lost my partition. I do not know how to do.

    ReplyDelete