Fix #1593
This commit is contained in:
parent
6e7a78dbd2
commit
9bd33136da
|
@ -226,10 +226,11 @@ sub check_memory_enhanced_pool {
|
||||||
return_type => 1
|
return_type => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $physical_array = {};
|
||||||
foreach my $oid (keys %{$snmp_result}) {
|
foreach my $oid (keys %{$snmp_result}) {
|
||||||
next if ($oid !~ /^$mapping_enh_memory_pool->{cempMemPoolName}->{oid}\.(.*)$/);
|
next if ($oid !~ /^$mapping_enh_memory_pool->{cempMemPoolName}->{oid}\.(.*?)\.(.*)$/);
|
||||||
my $instance = $1;
|
my ($physical_index, $mem_index) = ($1, $2);
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping_enh_memory_pool, results => $snmp_result, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping_enh_memory_pool, results => $snmp_result, instance => $physical_index . '.' . $mem_index);
|
||||||
|
|
||||||
$self->{checked_memory} = 1;
|
$self->{checked_memory} = 1;
|
||||||
if (defined($self->{option_results}->{filter_pool}) && $self->{option_results}->{filter_pool} ne '' &&
|
if (defined($self->{option_results}->{filter_pool}) && $self->{option_results}->{filter_pool} ne '' &&
|
||||||
|
@ -240,13 +241,36 @@ sub check_memory_enhanced_pool {
|
||||||
|
|
||||||
my $used = defined($result->{cempMemPoolHCUsed}) ? $result->{cempMemPoolHCUsed} : $result->{cempMemPoolUsed};
|
my $used = defined($result->{cempMemPoolHCUsed}) ? $result->{cempMemPoolHCUsed} : $result->{cempMemPoolUsed};
|
||||||
my $free = defined($result->{cempMemPoolHCFree}) ? $result->{cempMemPoolHCFree} : $result->{cempMemPoolFree};
|
my $free = defined($result->{cempMemPoolHCFree}) ? $result->{cempMemPoolHCFree} : $result->{cempMemPoolFree};
|
||||||
$self->{memory}->{$instance} = {
|
if ($used + $free <= 0) {
|
||||||
|
$self->{output}->output_add(long_msg => "skipping '" . $result->{cempMemPoolName} . "': no total.", debug => 1);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
$physical_array->{$physical_index} = 1;
|
||||||
|
$self->{memory}->{$physical_index . '.' . $mem_index} = {
|
||||||
display => $result->{cempMemPoolName},
|
display => $result->{cempMemPoolName},
|
||||||
total => $used + $free,
|
total => $used + $free,
|
||||||
used => $used,
|
used => $used,
|
||||||
prct_used => -1,
|
prct_used => -1,
|
||||||
|
physical_index => $physical_index,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scalar(keys %$physical_array) > 0) {
|
||||||
|
my $oid_entPhysicalName = '.1.3.6.1.2.1.47.1.1.1.1.7';
|
||||||
|
$self->{snmp}->load(
|
||||||
|
oids => [$oid_entPhysicalName],
|
||||||
|
instances => [keys %$physical_array],
|
||||||
|
instance_regexp => '^(.*)$'
|
||||||
|
);
|
||||||
|
$snmp_result = $self->{snmp}->get_leef(nothing_quit => 1);
|
||||||
|
foreach (keys %{$self->{memory}}) {
|
||||||
|
if (defined($snmp_result->{ $oid_entPhysicalName . '.' . $self->{memory}->{$_}->{physical_index} })) {
|
||||||
|
$self->{memory}->{$_}->{display} =
|
||||||
|
$snmp_result->{ $oid_entPhysicalName . '.' . $self->{memory}->{$_}->{physical_index} } . '_' . $self->{memory}->{$_}->{display};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $mapping_memory_process = {
|
my $mapping_memory_process = {
|
||||||
|
|
Loading…
Reference in New Issue