bonding mode 4 monitoring:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 12 Apr 2011 21:51:36 +0000 (07:51 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 12 Apr 2011 23:06:02 +0000 (09:06 +1000)
we can not just check if MII Status is up for bonding mode 4, since the kernel will always report the bond device as UP
even if all cables are disconneccted.

For mode 4, ignore the status of the bond device and instead chek if at least one slave interface is up
when determining if the device is good or bad

config/events.d/10.interface

index 2ca8eaea0426b3c91e871e5afc4d7062f8e53639..e0689c4397b0aa84e411dd668a6c5e57db56a416 100755 (executable)
@@ -63,6 +63,14 @@ monitor_interfaces()
                        ctdb setifacelink $IFACE down
                        continue;
                }
+               grep -q '^Bonding Mode: IEEE 802.3ad Dynamic link aggregation' /proc/net/bonding/$REALIFACE && {
+                       grep 'MII Status:' /proc/net/bonding/$REALIFACE | tail -n +2 | grep -q '^MII Status: up' || {
+                               echo No active slaves for 802.ad bond device $REALIFACE
+                               ctdb setifacelink $IFACE down
+                               fail=1
+                               continue
+                       }
+               }
                ok=1 # we only set ok for interfaces known to ctdbd
                ctdb setifacelink $IFACE up
                continue;