Skip to content

Commit

Permalink
Merge pull request #547 from rocket357/bonding_iface_check_fix
Browse files Browse the repository at this point in the history
Update bonding_iface_check.py
  • Loading branch information
tonytan4ever authored Aug 21, 2018
2 parents dea1b5f + 5f26d55 commit 4b9f2db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion playbooks/files/rax-maas/plugins/bonding_iface_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ def bonding_ifaces_check(_):
)

has_slave_down = False
slave_count = 0
for idx, line in enumerate(bonding_iface_check_cmd_output_lines):
if line.startswith("Slave Interface"):
slave_count = slave_count + 1
slave_inface_mii_status_line = (
bonding_iface_check_cmd_output_lines[idx + 1]
)
slave_inface_mii_status = (
slave_inface_mii_status_line.split(":")[1]
)
if 'down' in slave_inface_mii_status:
if 'up' not in slave_inface_mii_status or slave_count < 2:
has_slave_down = True

if has_slave_down:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
upgrade:
- |
Add slave_count to ensure the bond has redundancy and check explicitly for not "up"
This ensures a bond slave that is marked down (should only occur in a maintenance
window) triggers an alert.

0 comments on commit 4b9f2db

Please sign in to comment.