From 846adb3a7c31f91018df644fd6e9d138e7355482 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 21 Aug 2015 11:38:11 +0200 Subject: [PATCH] + Fix Big integers --- network/alcatel/isam/snmp/mode/vlantraffic.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network/alcatel/isam/snmp/mode/vlantraffic.pm b/network/alcatel/isam/snmp/mode/vlantraffic.pm index 0e7da0380..1a1181829 100644 --- a/network/alcatel/isam/snmp/mode/vlantraffic.pm +++ b/network/alcatel/isam/snmp/mode/vlantraffic.pm @@ -27,6 +27,7 @@ use warnings; use centreon::plugins::values; use centreon::plugins::statefile; use Digest::MD5 qw(md5_hex); +use bigint qw/hex/; # Need it because we have big counters in octet strings my $maps_counters = { vlan => { @@ -269,8 +270,8 @@ sub manage_selection { next if ($_ !~ /^$oid_extendPortVlanCurrent1DayUpFwdByteCounter\.(\d+)\.(\d+)$/); my $vlan_index = $2; - my $in = oct("0b". unpack('b*', $self->{results}->{$oid_extendPortVlanCurrent1DayDnFwdByteCounter . '.' . $1 . '.' . $vlan_index})); - my $out = oct("0b". unpack('b*', $self->{results}->{$_})); + my $in = hex(unpack('H*', $self->{results}->{$oid_extendPortVlanCurrent1DayDnFwdByteCounter . '.' . $1 . '.' . $vlan_index})); + my $out = hex(unpack('H*', $self->{results}->{$_})); $self->{vlan}->{$vlan_index}->{in} += $in * 8; $self->{vlan}->{$vlan_index}->{out} += $out * 8;