patch ipsec palo alto ssh

This commit is contained in:
garnier-quentin 2020-04-23 17:15:32 +02:00 committed by Lotfi zaouche
parent ab599a1560
commit a90e82c57d

View File

@ -121,12 +121,23 @@ sub manage_selection {
$self->{global}->{total_ipsec}++; $self->{global}->{total_ipsec}++;
} }
$result = $options{custom}->execute_command(command => 'show vpn ipsec-sa', ForceArray => ['entry']);
foreach (@{$result->{entries}->{entry}}) {
if (defined($self->{tunnels}->{$_->{gwid}})) {
$self->{tunnels}->{$_->{gwid}}->{tid} = $_->{tid};
}
}
$result = $options{custom}->execute_command(command => 'show vpn flow', ForceArray => ['entry']); $result = $options{custom}->execute_command(command => 'show vpn flow', ForceArray => ['entry']);
foreach my $gwid (keys %{$self->{tunnels}}) {
next if (!defined($self->{tunnels}->{$gwid}->{tid}));
foreach (@{$result->{IPSec}->{entry}}) { foreach (@{$result->{IPSec}->{entry}}) {
next if ($self->{tunnels}->{$gwid}->{tid} ne $_->{id});
$self->{tunnels}->{$_->{gwid}}->{state} = $_->{state}; $self->{tunnels}->{$_->{gwid}}->{state} = $_->{state};
$self->{tunnels}->{$_->{gwid}}->{monitor_status} = $_->{mon}; $self->{tunnels}->{$_->{gwid}}->{monitor_status} = $_->{mon};
} }
} }
}
1; 1;