Module: check_mk
Branch: master
Commit: 90f18168c5dde02baea364db0976f0abe91d7386
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90f18168c5dde0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 16 10:00:48 2018 +0200
6803 FIX cisco_hsrp: Treat 'listen' state also as OK if it was known during
discovery
Change-Id: I9747a941a868a521519860f27b83448a379473df
---
.werks/6803 | 10 ++++++++++
checks/cisco_hsrp | 7 ++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/.werks/6803 b/.werks/6803
new file mode 100644
index 0000000..124a6fa
--- /dev/null
+++ b/.werks/6803
@@ -0,0 +1,10 @@
+Title: cisco_hsrp: Treat 'listen' state also as OK if it was known during
discovery
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1539676700
+Class: fix
+
+
diff --git a/checks/cisco_hsrp b/checks/cisco_hsrp
index 4a31f0e..01a9b97 100644
--- a/checks/cisco_hsrp
+++ b/checks/cisco_hsrp
@@ -108,14 +108,11 @@ def check_cisco_hsrp(item, params, info):
# Validate that we the inventorized state is a "good one"
# if it's also the one we have now, then we're fine.
- if hsrp_state_wanted == 5 and hsrp_state == hsrp_state_wanted:
+ if hsrp_state_wanted in [3, 5, 6] and hsrp_state == hsrp_state_wanted:
state = 0
msgtxt = "Redundancy Group %s is OK" % vip_grp
- elif hsrp_state_wanted == 6 and hsrp_state == hsrp_state_wanted:
- state = 0
- msgtxt = "Redundancy Group %s is OK" % vip_grp
# otherwise if it's a good one, but flipped, then we are in a failover
- elif hsrp_state == 5 or hsrp_state == 6:
+ elif hsrp_state in [5, 6]:
state = 1
msgtxt = "Redundancy Group %s has failed over" % hsrp_grp
# anything else must be a non-operative state already