AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  EtherChannel

    Posted Tue April 26, 2016 04:20 PM

    Originally posted by: Jack0fAll


    What command i can use to find the physical adapters that make up an EtherChannel adapter?



  • 2.  Re: EtherChannel

    Posted Wed April 27, 2016 07:27 AM

    Originally posted by: sanket


    You can use lsattr command of AIX on etherchannel device.

    lsattr -El <etherchannel adapter> -a adapter_names

     

    Alternatively you can also use smitty 

    smitty etherchannel --> List All EtherChannels / Link Aggregations

     

    Thanks



  • 3.  Re: EtherChannel

    Posted Mon June 13, 2016 07:08 AM

    Originally posted by: grukrz1



    you can use some scripting to get what you need, e.g.

     

    #!/bin/ksh
    
    crr='\033[31m'
    cr='\033[1;34m'
    cn='\033[00m'
    czb='\033[1;32m'
    czu='\033[4;33m'
    
    echo "###################`hostname`###################"
    ifconfig -a | grep ^en | awk -F: {'print $1'} |
    while read line
    do
    NIC=`echo $line | sed 's/en/ent/g'`
    CARD=`lsdev -Cc adapter | grep "^$NIC "|awk -F\/ '{print $1}'|awk '{print $3,$1" ("$2")"}' `
    if `echo $CARD | grep EtherChannel 1>/dev/null 2>/dev/null`
       then
       ACNL=`entstat -d ${NIC}|awk '/Active channel:/{print $3}'`
       echo "\n${crr}$CARD:${cn} Active channel is: ${czu}${ACNL}${cn}"
       #echo " `entstat -d ${NIC}| grep \"Active channel:\"`"
       i=1
       LIST=`lsattr -El $NIC | grep adapter_names | awk {'print $2'} | sed "s/,/ /g"`
       for ITEM in $LIST
          do
          [ "${ACNL}" == "primary" ] && CT=${czu} || CT=${cn}
          echo " primary : ${CT}`lsdev -Cc adapter | grep \"^$ITEM \"|awk '{print $1}'`${cn}"
          let i=$i+1
       done
       unset ITEM
       i=1
       LIST=`lsattr -El $NIC | grep backup_adapter | awk {'print $2'} | sed "s/,/ /g"`
       if `echo $LIST | grep NONE 1>/dev/null 2>/dev/null`
       then
       do=nothing
       else
       for ITEM in $LIST
          do
          [ "${ACNL}" == "backup" ] && CT=${czu} || CT=${cn}
          echo " backup  : ${CT}`lsdev -Cc adapter | grep \"^$ITEM \"|awk '{print $1}'`${cn}"
          let i=$i+1
       done
       fi
    else
       echo "\n${cy}$CARD${cn}"
    fi
    done
    echo ""
    

    sample output: