From 7a1e5339a971e29ec0c01812bd7e26b709a22036 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Wed, 12 Jan 2011 16:15:46 +0100 Subject: [PATCH] Small fix of thresholds to CPU check Signed-off-by: Sven Velt --- check_naf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check_naf.py b/check_naf.py index d3e4a15..94602a5 100755 --- a/check_naf.py +++ b/check_naf.py @@ -92,6 +92,11 @@ class CheckNAF(SNMPMonitoringPlugin): # cputimeidle = int(self.SNMPGET(self.OID['CPU_Time_Idle'])) cpu_cs = self.SNMPGET(self.OID['CPU_Context_Switches']) + if '%' in warn: + warn = warn[:-1] + if '%' in crit: + crit = crit[:-1] + returncode = self.value_wc_to_returncode(cpu_timebusy, warn, crit) output = 'CPU ' + str(cpu_timebusy) + '% busy, CPU architecture: ' + self.Status2String['CPU_Arch'].get(cpu_arch) perfdata = [] @@ -149,6 +154,7 @@ class CheckNAF(SNMPMonitoringPlugin): return self.remember_check('disk', returncode, output, perfdata=perfdata, target=target) + def check_global(self): model = self.SNMPGET(self.OID['Model']) globalstatus = int(self.SNMPGET(self.OID['Global_Status']))