From c6ff5457a5083eff5676686bf009681cef6bbb7c Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 9 Nov 2022 11:25:43 +0100 Subject: [PATCH] (plugin) os::windows::wsman - mode storages fix illegal division by zero (#4047) --- centreon-plugins/os/windows/wsman/mode/storages.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/centreon-plugins/os/windows/wsman/mode/storages.pm b/centreon-plugins/os/windows/wsman/mode/storages.pm index 39adae453..e003840a5 100644 --- a/centreon-plugins/os/windows/wsman/mode/storages.pm +++ b/centreon-plugins/os/windows/wsman/mode/storages.pm @@ -142,6 +142,8 @@ sub manage_selection { next if (defined($self->{option_results}->{filter_type}) && $self->{option_results}->{filter_type} ne '' && $type !~ /$self->{option_results}->{filter_type}/); + next if (!defined($_->{Capacity}) || $_->{Capacity} eq '' || $_->{Capacity} == 0); + my ($total, $free) = ($_->{Capacity}, $_->{FreeSpace}); $self->{storages}->{ $_->{Name} } = { name => $_->{Name},