+ Fix ggsn juniper: right unit for traffic

This commit is contained in:
garnier-quentin 2015-06-13 18:50:08 +02:00
parent ef40bca891
commit 43ee7f1582
2 changed files with 8 additions and 4 deletions

View File

@ -53,7 +53,7 @@ my $maps_counters = {
output_template => 'Traffic In : %s %s/s', output_template => 'Traffic In : %s %s/s',
perfdatas => [ perfdatas => [
{ label => 'traffic_in', value => 'ggsnApnUplinkBytes_per_second', template => '%s', { label => 'traffic_in', value => 'ggsnApnUplinkBytes_per_second', template => '%s',
unit => 'b', min => 0, label_extra_instance => 1, cast_int => 1, instance_use => 'ggsnApnName_absolute' }, unit => 'b/s', min => 0, label_extra_instance => 1, cast_int => 1, instance_use => 'ggsnApnName_absolute' },
], ],
} }
}, },
@ -66,7 +66,7 @@ my $maps_counters = {
output_template => 'Traffic Out : %s %s/s', output_template => 'Traffic Out : %s %s/s',
perfdatas => [ perfdatas => [
{ label => 'traffic_out', value => 'ggsnApnDownlinkBytes_per_second', template => '%s', { label => 'traffic_out', value => 'ggsnApnDownlinkBytes_per_second', template => '%s',
unit => 'b', min => 0, label_extra_instance => 1, cast_int => 1, instance_use => 'ggsnApnName_absolute' }, unit => 'b/s', min => 0, label_extra_instance => 1, cast_int => 1, instance_use => 'ggsnApnName_absolute' },
], ],
} }
}, },
@ -378,6 +378,8 @@ sub manage_selection {
next; next;
} }
$result->{ggsnApnDownlinkBytes} *= 8 if (defined($result->{ggsnApnDownlinkBytes}));
$result->{ggsnApnUplinkBytes} *= 8 if (defined($result->{ggsnApnUplinkBytes}));
$self->{apn_selected}->{$instance} = $result; $self->{apn_selected}->{$instance} = $result;
} }

View File

@ -52,7 +52,7 @@ my $maps_counters = {
output_template => 'Traffic In : %s %s/s', output_template => 'Traffic In : %s %s/s',
perfdatas => [ perfdatas => [
{ label => 'traffic_in', value => 'ggsnUplinkBytes_per_second', template => '%s', { label => 'traffic_in', value => 'ggsnUplinkBytes_per_second', template => '%s',
unit => 'b', min => 0, cast_int => 1 }, unit => 'b/s', min => 0, cast_int => 1 },
], ],
} }
}, },
@ -65,7 +65,7 @@ my $maps_counters = {
output_template => 'Traffic Out : %s %s/s', output_template => 'Traffic Out : %s %s/s',
perfdatas => [ perfdatas => [
{ label => 'traffic_out', value => 'ggsnDownlinkBytes_per_second', template => '%s', { label => 'traffic_out', value => 'ggsnDownlinkBytes_per_second', template => '%s',
unit => 'b', min => 0, cast_int => 1 }, unit => 'b/s', min => 0, cast_int => 1 },
], ],
} }
}, },
@ -348,6 +348,8 @@ sub manage_selection {
$self->{results} = $self->{snmp}->get_table(oid => $oid_ggsnGlobalStats, $self->{results} = $self->{snmp}->get_table(oid => $oid_ggsnGlobalStats,
nothing_quit => 1); nothing_quit => 1);
$self->{global} = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => '0'); $self->{global} = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => '0');
$self->{global}->{ggsnDownlinkBytes} *= 8 if (defined($self->{global}->{ggsnDownlinkBytes}));
$self->{global}->{ggsnUplinkBytes} *= 8 if (defined($self->{global}->{ggsnUplinkBytes}));
} }
1; 1;