checks if var exists

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@10280 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Sylvestre Ho 2010-03-30 11:43:10 +00:00
parent 48a53e0260
commit aa5f588b48
1 changed files with 3 additions and 1 deletions

View File

@ -219,7 +219,9 @@ my $realM_used = $used_mem->{$OID_RealM_storage_used} * $alloc_units->{$OID_Real
my $cache_used = 0; my $cache_used = 0;
if (defined $indexC > 0) { if (defined $indexC > 0) {
$cache_used = $total_mem->{$OID_Cache_storage_size} * $alloc_units->{$OID_Cache_storage_allocationUnits}; if (defined($total_mem->{$OID_Cache_storage_size}) && defined($alloc_units->{$OID_Cache_storage_allocationUnits})) {
$cache_used = $total_mem->{$OID_Cache_storage_size} * $alloc_units->{$OID_Cache_storage_allocationUnits};
}
} }
my $swap_size = $total_mem->{$OID_Swap_storage_size} * $alloc_units->{$OID_Swap_storage_allocationUnits}; my $swap_size = $total_mem->{$OID_Swap_storage_size} * $alloc_units->{$OID_Swap_storage_allocationUnits};