Fix #2090
This commit is contained in:
parent
b47977ced8
commit
0cf498cd39
|
@ -32,7 +32,7 @@ sub set_counters {
|
||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'global', type => 0 },
|
{ name => 'global', type => 0 },
|
||||||
{ name => 'tunnel', type => 1, cb_prefix_output => 'prefix_tunnel_output', message_multiple => 'All tunnels are ok' },
|
{ name => 'tunnel', type => 1, cb_prefix_output => 'prefix_tunnel_output', message_multiple => 'All tunnels are ok' }
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
|
@ -52,8 +52,8 @@ sub set_counters {
|
||||||
output_template => 'Traffic In : %s %s/s',
|
output_template => 'Traffic In : %s %s/s',
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' },
|
{ template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'tunnel-traffic-out', nlabel => 'ipsec.tunnel.traffic.out.bitspersecond', set => {
|
{ label => 'tunnel-traffic-out', nlabel => 'ipsec.tunnel.traffic.out.bitspersecond', set => {
|
||||||
|
@ -61,10 +61,10 @@ sub set_counters {
|
||||||
output_template => 'Traffic Out : %s %s/s',
|
output_template => 'Traffic Out : %s %s/s',
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' },
|
{ template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
|
||||||
],
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,8 +104,7 @@ sub manage_selection {
|
||||||
my $snmp_result = $options{snmp}->get_table(
|
my $snmp_result = $options{snmp}->get_table(
|
||||||
oid => $oid_wgIpsecTunnelEntry,
|
oid => $oid_wgIpsecTunnelEntry,
|
||||||
start => $mapping->{wgIpsecTunnelLocalAddr}->{oid},
|
start => $mapping->{wgIpsecTunnelLocalAddr}->{oid},
|
||||||
end => $mapping->{wgIpsecTunnelPeerAddr}->{oid},
|
end => $mapping->{wgIpsecTunnelPeerAddr}->{oid}
|
||||||
nothing_quit => 1
|
|
||||||
);
|
);
|
||||||
foreach (keys %$snmp_result) {
|
foreach (keys %$snmp_result) {
|
||||||
next if (!/$mapping->{wgIpsecTunnelLocalAddr}->{oid}\.(.*)/);
|
next if (!/$mapping->{wgIpsecTunnelLocalAddr}->{oid}\.(.*)/);
|
||||||
|
@ -125,7 +124,9 @@ sub manage_selection {
|
||||||
$options{snmp}->load(oids => [
|
$options{snmp}->load(oids => [
|
||||||
map($_->{oid}, values(%$mapping2))
|
map($_->{oid}, values(%$mapping2))
|
||||||
],
|
],
|
||||||
instances => [keys %{$self->{tunnel}}], instance_regexp => '^(.*)$');
|
instances => [keys %{$self->{tunnel}}],
|
||||||
|
instance_regexp => '^(.*)$'
|
||||||
|
);
|
||||||
$snmp_result = $options{snmp}->get_leef(nothing_quit => 1);
|
$snmp_result = $options{snmp}->get_leef(nothing_quit => 1);
|
||||||
foreach (keys %{$self->{tunnel}}) {
|
foreach (keys %{$self->{tunnel}}) {
|
||||||
my $result = $options{snmp}->map_instance(mapping => $mapping2, results => $snmp_result, instance => $_);
|
my $result = $options{snmp}->map_instance(mapping => $mapping2, results => $snmp_result, instance => $_);
|
||||||
|
|
Loading…
Reference in New Issue