diff --git a/network/checkpoint/snmp/mode/memory.pm b/network/checkpoint/snmp/mode/memory.pm index 4374e02b7..28b62898d 100644 --- a/network/checkpoint/snmp/mode/memory.pm +++ b/network/checkpoint/snmp/mode/memory.pm @@ -139,12 +139,14 @@ sub manage_selection { total => $results->{$oid_memTotalReal64}, }; - $self->{swap} = { - prct_used => ($results->{$oid_memActiveVirtual64} - $results->{$oid_memActiveReal64}) * 100 / ($results->{$oid_memTotalVirtual64} - $results->{$oid_memTotalReal64}), - used => $results->{$oid_memActiveVirtual64} - $results->{$oid_memActiveReal64}, - free => $results->{$oid_memTotalVirtual64} - $results->{$oid_memTotalReal64} - ($results->{$oid_memActiveVirtual64} - $results->{$oid_memActiveReal64}), - total => $results->{$oid_memTotalVirtual64} - $results->{$oid_memTotalReal64} - }; + if ($results->{$oid_memTotalVirtual64} > $results->{$oid_memTotalReal64}) { + $self->{swap} = { + prct_used => ($results->{$oid_memActiveVirtual64} - $results->{$oid_memActiveReal64}) * 100 / ($results->{$oid_memTotalVirtual64} - $results->{$oid_memTotalReal64}), + used => $results->{$oid_memActiveVirtual64} - $results->{$oid_memActiveReal64}, + free => $results->{$oid_memTotalVirtual64} - $results->{$oid_memTotalReal64} - ($results->{$oid_memActiveVirtual64} - $results->{$oid_memActiveReal64}), + total => $results->{$oid_memTotalVirtual64} - $results->{$oid_memTotalReal64} + }; + } $self->{malloc} = { failed_mallocs => $results->{$oid_fwKmemFailedAlloc} }; }