Module: check_mk
Branch: master
Commit: 905d604d8a2691c66460ac07cb70af6a1be7983e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=905d604d8a2691…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Mar 13 12:37:19 2017 +0100
Fixed invalid parameters
Change-Id: Ie3184eb18a3cfa33f65796d5231cbb1e9beed17c
---
checks/hr_cpu | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/checks/hr_cpu b/checks/hr_cpu
index ca03596..fc4d573 100644
--- a/checks/hr_cpu
+++ b/checks/hr_cpu
@@ -29,12 +29,14 @@
# .1.3.6.1.2.1.25.3.3.1.2.769 1 --> HOST-RESOURCES-MIB::hrProcessorLoad.769
-hr_cpu_default_levels = (80.0, 90.0)
+factory_settings["hr_cpu_default_levels"] = {
+ "levels" : (80.0, 90.0),
+}
def inventory_hr_cpu(info):
if len(info) >= 1:
- return [(None, "hr_cpu_default_levels")]
+ return [(None, {})]
def check_hr_cpu(_no_item, params, info):
@@ -54,14 +56,15 @@ def check_hr_cpu(_no_item, params, info):
check_info["hr_cpu"] = {
- 'inventory_function' : inventory_hr_cpu,
- 'check_function' : check_hr_cpu,
- 'service_description' : 'CPU utilization',
- 'has_perfdata' : True,
- 'snmp_info' : ('.1.3.6.1.2.1.25.3.3.1', [2]),
- 'snmp_scan_function' : lambda oid: \
- not not oid('.1.3.6.1.2.1.25.1.1.0'),
- # HOST-RESOURCES-MIB::hrSystemUptime.0
- 'group' : 'cpu_utilization_os',
- 'includes' : [ 'cpu_util.include' ],
+ 'inventory_function' : inventory_hr_cpu,
+ 'check_function' : check_hr_cpu,
+ 'service_description' : 'CPU utilization',
+ 'has_perfdata' : True,
+ 'snmp_info' : ('.1.3.6.1.2.1.25.3.3.1', [2]),
+ 'snmp_scan_function' : lambda oid: \
+ not not oid('.1.3.6.1.2.1.25.1.1.0'),
+ # HOST-RESOURCES-MIB::hrSystemUptime.0
+ 'group' : 'cpu_utilization_os',
+ 'includes' : [ 'cpu_util.include' ],
+ 'default_levels_variable' : 'hr_cpu_default_levels',
}