Module: check_mk
Branch: master
Commit: 7ca532c65fa3d862049e56824f02265e3a239b3c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7ca532c65fa3d8…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Nov 5 11:53:01 2014 +0100
cisco_cpu: improved scan function
---
checks/cisco_cpu | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/checks/cisco_cpu b/checks/cisco_cpu
index 43cc85f..ac79034 100644
--- a/checks/cisco_cpu
+++ b/checks/cisco_cpu
@@ -29,6 +29,11 @@
cisco_cpu_default_levels = (80.0, 90.0)
+def inventory_cisco_cpu(info):
+ print info
+ if info:
+ return [( None, 'cisco_cpu_default_levels') ]
+
def check_cisco_cpu(item, params, info):
if info[0][1]:
util = float(info[0][1])
@@ -46,12 +51,12 @@ def check_cisco_cpu(item, params, info):
check_info["cisco_cpu"] = {
"check_function" : check_cisco_cpu,
- "inventory_function" : lambda info: [(None,
"cisco_cpu_default_levels")],
+ "inventory_function" : inventory_cisco_cpu,
"service_description" : "CPU utilization",
"has_perfdata" : True,
"group" : "cpu_utilization",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.8.1") \
- or oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.5.1"),
+ "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.109.1.1.1.1.*"),
"snmp_info" : ( ".1.3.6.1.4.1.9.9.109.1.1.1.1", [ 5, 8 ]),
}