+ Fix node name in bigip
This commit is contained in:
parent
d002e7f2b5
commit
2795524af8
|
@ -271,14 +271,11 @@ sub manage_selection {
|
||||||
|
|
||||||
$self->{node} = {};
|
$self->{node} = {};
|
||||||
foreach my $oid (keys %{$self->{results}->{$branch}}) {
|
foreach my $oid (keys %{$self->{results}->{$branch}}) {
|
||||||
next if ($oid !~ /^$mapping->{$map}->{Name}->{oid}\.(.*)$/);
|
next if ($oid !~ /^$mapping->{$map}->{AvailState}->{oid}\.(.*)$/);
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping->{$map}, results => $self->{results}->{$branch}, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping->{$map}, results => $self->{results}->{$branch}, instance => $instance);
|
||||||
|
|
||||||
$result->{Name} = '';
|
$result->{Name} = $instance;
|
||||||
foreach (split /\./, $instance) {
|
|
||||||
$result->{Name} .= chr if ($_ >= 32 && $_ <= 126);
|
|
||||||
}
|
|
||||||
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||||
$result->{Name} !~ /$self->{option_results}->{filter_name}/) {
|
$result->{Name} !~ /$self->{option_results}->{filter_name}/) {
|
||||||
$self->{output}->output_add(long_msg => "Skipping '" . $result->{Name} . "': no matching filter name.");
|
$self->{output}->output_add(long_msg => "Skipping '" . $result->{Name} . "': no matching filter name.");
|
||||||
|
@ -289,7 +286,6 @@ sub manage_selection {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
$result->{StatusReason} = '-' if (!defined($result->{StatusReason}) || $result->{StatusReason} eq '');
|
$result->{StatusReason} = '-' if (!defined($result->{StatusReason}) || $result->{StatusReason} eq '');
|
||||||
$result->{Name} = centreon::plugins::misc::trim($result->{Name});
|
|
||||||
|
|
||||||
$self->{node}->{$instance} = { %$result };
|
$self->{node}->{$instance} = { %$result };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue