From e8cdfef72fe6c627fed261ef711c4e243c10a7e3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 13 Sep 2016 15:07:42 +0200 Subject: [PATCH] + Fix division by zero --- centreon/common/emc/navisphere/mode/disk.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/centreon/common/emc/navisphere/mode/disk.pm b/centreon/common/emc/navisphere/mode/disk.pm index a5bf080e5..3971afccc 100644 --- a/centreon/common/emc/navisphere/mode/disk.pm +++ b/centreon/common/emc/navisphere/mode/disk.pm @@ -81,7 +81,11 @@ sub custom_utils_calc { my $diff_busy = $options{new_datas}->{$self->{instance} . '_busy_ticks'} - $options{old_datas}->{$self->{instance} . '_busy_ticks'}; my $diff_idle = $options{new_datas}->{$self->{instance} . '_idle_ticks'} - $options{old_datas}->{$self->{instance} . '_idle_ticks'}; - + + if (($diff_busy + $diff_idle) == 0) { + $self->{error_msg} = "wait new values"; + return -3; + } $self->{result_values}->{utils} = $diff_busy * 100 / ($diff_busy + $diff_idle); $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; return 0;