Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Wagner
Participant

One-Liner for status summary of all configured bonds

I've created a one-liner to get a simple status summary of all configured bonds. Probable it helps someone:

ls /proc/net/bonding/ | while read BOND_NAME; do BOND_STATE=`cat /proc/net/bonding/$BOND_NAME|grep Status|head -1|cut -d":" -f2`; SLAVE_CNT=`cat /proc/net/bonding/$BOND_NAME|grep "Slave Interface"|wc -l`; ACTIVE_SLAVE_CNT=`cat /proc/net/bonding/$BOND_NAME|grep -A1 "Slave Interface"|grep "Status: up"|wc -l`; echo "$BOND_NAME:$BOND_STATE ($ACTIVE_SLAVE_CNT/$SLAVE_CNT members up)"; done;

Sample  output:

bond0: up (2/2 members up)
bond1: up (2/2 members up)
bond2: down (0/2 members up)
bond3: down (0/0 members up)

Successfully tested on R80.20 and R81.10

0 Kudos
2 Replies
Chris_Atkinson
Employee Employee
Employee

Note there are related CLISH commands here such as:

show cluster bond {all | name <bond_name>}

CCSM R77/R80/ELITE
0 Kudos
Michael_Wagner
Participant

Thanks! Sincerely this only works when HA module is started. I needed a quick way to verify network connectivity during a migration before the cluster is configured.

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events