What is the most common way of monitoring devices belonging to a bond?
Issue
What's the best option to properly monitor bonding devices (master & slaves).
Is there a way to generate alert whenever a nic belonging to a status change for any version of Red Hat Enterprise Linux (RHEL) above (and including) RHEL4?
If the format of /proc/net/bonding/bondX is guaranteed to be constant between release, the following bash script should work :
for BONDINTF in $(ls ${PROCDIR}/*)
do
for DOWNIF in $(awk -F\: 'BEGIN{x=""};{if ($1 == "MII Status" && $2 !~/up/ && x != "" ) {print x}}; {if ($0 !~/Mode/) {x=$2}}' ${BONDINTF})
do
# generate an alert on $BONDIF about $DOWNIF
done
done
Is it guaranteed to work on any version of RHEL ?
Environment
- Red Hat Enterprise Linux 4, 5 or 6.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
