Module: check_mk
Branch: master
Commit: 32a01c76766552473f66039bd8f45f19d8b01a4e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=32a01c76766552…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Tue Sep 18 12:17:34 2012 +0200
checks/cisco_hsrp: Do not inventorize HSRP groups that aren't working at time of
inventory
---
checkman/cisco_hsrp | 10 +++++-----
checks/cisco_hsrp | 5 ++++-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/checkman/cisco_hsrp b/checkman/cisco_hsrp
index f9c70ef..c125f83 100644
--- a/checkman/cisco_hsrp
+++ b/checkman/cisco_hsrp
@@ -30,8 +30,8 @@ item:
The Virtual IP of the failover group.
inventory:
- The check reads the HSRP MIB and creates one service per virtual IP. It also
- stores the HSRP state of
- the IP as seen by the monitored device, normally either standby or active.
- It also stores the ID of
- the failover group. (For future use)
+ The check reads the HSRP MIB and creates one service per virtual IP.
+ If the HSRP state of the group is either active or standby, a service
+ will be created. It also stores this HSRP state of
+ the IP as seen by the monitored device.
+ It also stores the ID of the failover group. (For future use)
diff --git a/checks/cisco_hsrp b/checks/cisco_hsrp
index 06181ad..0d38a19 100644
--- a/checks/cisco_hsrp
+++ b/checks/cisco_hsrp
@@ -57,8 +57,11 @@ def inventory_cisco_hsrp(info):
for line in info:
hsrp_grp_entry, vip, actrouter, sbrouter, hsrp_state, vmac = line
interface_index, hsrp_grp = hsrp_grp_entry.split(".")
+ hsrp_state = int(hsrp_state)
+ # if the group is in a working state (both routers see and talk to each other),
# inventorize HSRP group name+IP and the standby state as seen from
"this" box.
- inventory.append( (vip, (hsrp_grp, int(hsrp_state))) )
+ if hsrp_state in [ 5, 6 ]:
+ inventory.append( (vip, (hsrp_grp, hsrp_state)) )
return inventory