Skip to content

Commit

Permalink
Bugfix: sFlow having the router address and not agent IP, bad metric …
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
lspgn committed Apr 13, 2018
1 parent 0e76804 commit 3c6d6fc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions goflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (s *state) decodeNetFlow(msg interface{}) error {
prometheus.Labels{
"router": key,
"version": "10",
"type": "OptionsTemplateFlowSet",
"type": "TemplateFlowSet",
}).
Add(float64(len(fsConv.Records)))

Expand Down Expand Up @@ -485,10 +485,6 @@ func (s *state) decodeSflow(msg interface{}) error {
pkt := msg.(BaseMessage)
buf := bytes.NewBuffer(pkt.Payload)
key := pkt.Src.String()
routerAddr := pkt.Src
if routerAddr.To4() != nil {
routerAddr = routerAddr.To4()
}

timeTrackStart := time.Now()
msgDec, err := sflow.DecodeMessage(buf)
Expand Down Expand Up @@ -590,7 +586,6 @@ func (s *state) decodeSflow(msg interface{}) error {
for _, fmsg := range flowMessageSet {
fmsg.TimeRecvd = ts
fmsg.TimeFlow = ts
fmsg.RouterAddr = routerAddr
}

s.produceFlow(flowMessageSet)
Expand Down

0 comments on commit 3c6d6fc

Please sign in to comment.