Module: check_mk
Branch: master
Commit: d8c4eac8f3592efcc66ee6173ece2654f44099c8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8c4eac8f3592e…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 24 10:15:14 2015 +0200
fixed error: divsion by zero
---
checks/emcvnx_sp_util | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/checks/emcvnx_sp_util b/checks/emcvnx_sp_util
index 8ebbdf1..a8bf735 100644
--- a/checks/emcvnx_sp_util
+++ b/checks/emcvnx_sp_util
@@ -47,7 +47,10 @@ def check_emcvnx_sp_util(item, params, info):
warn, crit = params
busy_ticks_rate = get_rate("emcvnx_sp_util.busy_ticks", now, busy_ticks )
idle_ticks_rate = get_rate("emcvnx_sp_util.idle_ticks", now, idle_ticks )
- sp_util = 100 * (busy_ticks_rate / (busy_ticks_rate + idle_ticks_rate))
+ if busy_ticks_rate + idle_ticks_rate == 0:
+ sp_util = 0
+ else:
+ sp_util = 100 * (busy_ticks_rate / (busy_ticks_rate + idle_ticks_rate))
infotext = "%.1f%%" % sp_util
if sp_util >= crit:
state = 2