Module: check_mk
Branch: master
Commit: b8fb89b542ce5fcb7dfbeb3ed181a2c9fe41f7ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8fb89b542ce5f…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Feb 6 16:40:43 2018 +0100
cisco_hsrp: Convert to new check_info format
Change-Id: I8528f75676e84ff180fa784234cf10a66876c919
---
checks/cisco_hsrp | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/checks/cisco_hsrp b/checks/cisco_hsrp
index 3df1965..f0c7a74 100644
--- a/checks/cisco_hsrp
+++ b/checks/cisco_hsrp
@@ -128,21 +128,17 @@ def check_cisco_hsrp(item, params, info):
return 3, "HSRP Group not found in Agent output"
-
-# FIXME: Outdated format. Fix after discussing WATO options.
-check_info["cisco_hsrp"] = (check_cisco_hsrp, "HSRP Group %s", 0,
inventory_cisco_hsrp)
-
-snmp_info["cisco_hsrp"] = \
- ( ".1.3.6.1.4.1.9.9.106.1.2.1.1", [
- OID_END,
- "11", # cHsrpGrpVirtualIpAddr
- "13", # cHsrpGrpActiveRouter
- "14", # cHsrpGrpStandbyRouter
- "15", # cHsrpGrpStandbyState
- "16", # cHsrpGrpVirtualMacAddr
- ])
-
-# We can't scan for the HSRP table since the entries are indexed
-# based on information we dont have without fetching all of it
-# Instead we use the HSRP timeout
-snmp_scan_functions["cisco_hsrp"] = lambda oid: "cisco" in
oid(".1.3.6.1.2.1.1.1.0").lower() and
oid(".1.3.6.1.4.1.9.9.106.1.1.1.0")
+check_info["cisco_hsrp"] = {
+ "inventory_function" : inventory_cisco_hsrp,
+ "check_function" : check_cisco_hsrp,
+ "service_description" : "HSRP Group %s",
+ "snmp_info" : ( ".1.3.6.1.4.1.9.9.106.1.2.1.1", [
+ OID_END,
+ "11", # cHsrpGrpVirtualIpAddr
+ "13", # cHsrpGrpActiveRouter
+ "14", # cHsrpGrpStandbyRouter
+ "15", # cHsrpGrpStandbyState
+ "16", # cHsrpGrpVirtualMacAddr
+ ]),
+ "snmp_scan_function" : lambda oid: "cisco" in
oid(".1.3.6.1.2.1.1.1.0").lower() and
oid(".1.3.6.1.4.1.9.9.106.1.1.1.0"),
+}