Module: check_mk
Branch: master
Commit: 06bce78f7bf0e32a3127cc24e533a35c724e51a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06bce78f7bf0e3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 20 10:29:51 2012 +0100
hpux_cpu handles missing cpu line in agent outpu now
---
checks/hpux_cpu | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/checks/hpux_cpu b/checks/hpux_cpu
index badd63c..726e25d 100644
--- a/checks/hpux_cpu
+++ b/checks/hpux_cpu
@@ -31,12 +31,16 @@
cpuload_default_levels = (5, 10)
def inventory_hpux_cpu_load(info):
- if len(info) == 2 and 'load' in info[0]:
+ if len(info) >= 1 and 'load' in info[0]:
return [(None, "cpuload_default_levels")]
def check_hpux_cpu_load(item, params, info):
load = [ float(l.strip(',')) for l in info[0][-3:] ]
- num_cpus = int(info[1][0])
+ # Assuming 1 cpu when none can be found in the agent output
+ try:
+ num_cpus = int(info[1][0])
+ except:
+ num_cpus = 1
warn, crit = params # apply on 15min average, relative to number of CPUs
warn = warn * num_cpus