AS-Stats icon indicating copy to clipboard operation
AS-Stats copied to clipboard

no sFlowSample->{'HeaderBin'} in sflow packets

Open Rico29 opened this issue 6 years ago • 0 comments

Hello, in asstatsd.pl, line my (undef, $ethertype, $ipdata) = unpack('a12H4a*', $sFlowSample->{'HeaderBin'}); throws warnings, because my sflow samples does not have a "HeaderBin" part. I'm using pmacct as sflow sender.

example of sflow packet shown via Data::Dumper :

$VAR1 = {
          'GatewayAsRouter' => 0,
          'GatewayDestAsPaths' => [
                                    {
                                      'asPathSegmentType' => 1,
                                      'lengthAsList' => 1,
                                      'AsPath' => []
                                    }
                                  ],
          'flowRecordsCount' => 4,
          'GatewayCommunities' => [],
          'outputInterface' => 1,
          'drops' => 0,
          'sourceIdIndex' => 1,
          'SwitchSrcPriority' => 0,
          'GatewayAsSourcePeer' => 0,
          'sampleTypeEnterprise' => 0,
          'EtherDestMac' => '000000330001',
          'SwitchDestVlan' => 51,
          'samplePool' => 14283505,
          'samplingRate' => 100,
          'inputInterface' => 1073741823,
          'HEADERDATA' => 'HEADERDATA',
          'GatewayLengthCommunitiesList' => 0,
          'GatewayIpVersionNextHopRouter' => 1,
          'sampleLength' => 216,
          'SwitchSrcVlan' => 0,
          'HeaderFrameLength' => 58,
          'HeaderProtocol' => 4,
          'sampleSequenceNumber' => 142453,
          'sampleTypeFormat' => 1,
          'HeaderStrippedLength' => 1423979124,
          'EtherPackettype' => 76,
          'SWITCHDATA' => 'SWITCHDATA',
          'SwitchDestPriority' => 0,
          'GatewayAsSource' => 0,
          'GatewayDestAsPathsCount' => 1,
          'ETHERNETFRAMEDATA' => 'ETHERNETFRAMEDATA',
          'GATEWAYDATA' => 'GATEWAYDATA',
          'sourceIdType' => 0,
          'EtherSrcMac' => '000000020000',
          'HeaderSizeByte' => 3217254405,
          'GatewayIpAddressNextHopRouter' => '0.0.0.0',
          'localPref' => 0,
          'EtherMacPacketlength' => 0
        };

how can I fix this ? Regards

Rico29 avatar Aug 13 '18 07:08 Rico29