From 01b89215fc7045361c219de9963bcaa4465a3878 Mon Sep 17 00:00:00 2001 From: Sylvestre Ho Date: Tue, 30 Mar 2010 11:43:10 +0000 Subject: [PATCH] checks if var exists git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@10280 6bcd3966-0018-0410-8128-fd23d134de7e --- src/check_centreon_snmp_memory | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/check_centreon_snmp_memory b/src/check_centreon_snmp_memory index 5f774e352..8af692ab0 100644 --- a/src/check_centreon_snmp_memory +++ b/src/check_centreon_snmp_memory @@ -219,7 +219,9 @@ my $realM_used = $used_mem->{$OID_RealM_storage_used} * $alloc_units->{$OID_Real my $cache_used = 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};