Module: check_mk
Branch: master
Commit: c50d8e401830e01cea7fbc1ea97164c24670fabd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c50d8e401830e0…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Apr 8 17:25:33 2013 +0200
cpu_util.include: fixed bug when params are set to None
---
ChangeLog | 1 +
checks/cpu_util.include | 5 ++++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 15bb0a1..36ead63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,6 +63,7 @@
* if64_tplink: special new check for TP Link switches with broken SNMP output
* windows_agent: check_mk.ini: new option "port" - specifies agent port
* winperf_processor: introduce averaging, support predictive levels
+ * cpu_util.include: fixed bug when params are set to None
Notifications:
* notify.py: unique spoolfiles name no longer created with uuid
diff --git a/checks/cpu_util.include b/checks/cpu_util.include
index a6e2661..fe21bb8 100644
--- a/checks/cpu_util.include
+++ b/checks/cpu_util.include
@@ -40,7 +40,9 @@ def check_cpu_util(util, params, this_time = None):
if this_time == None:
this_time = time.time()
- if type(params) == tuple:
+ if params == None:
+ params = {}
+ elif type(params) == tuple:
params = {
"levels" : params,
}
@@ -63,6 +65,7 @@ def check_cpu_util(util, params, this_time = None):
warn, crit = levels # only for perfdata
else:
warn, crit = None, None
+
state, extrainfo, extraperf = check_levels(check_against, counter, levels)
if extrainfo:
infotext += ", " + extrainfo