mbolli / nfsen-ng

Responsive NetFlow visualizer built on top of nfdump tools.
Apache License 2.0
232 stars 43 forks source link

nfsen-ng: 400 - Bad Request. Not enough parameters #25

Closed vantage255 closed 5 years ago

vantage255 commented 5 years ago

When I make the API request: http://Flowserver/nfsen-ng/api/graph?datestart=1558137600&dateend=1558191175&type=flows&sources[0]=Router.1&sources[1]=Router.2&protocols[0]=tcp&ports[0]=80

I get the reply 400 - Bad Request. Not enough parameters in my browser and nfsen-ng: 400 - Bad Request. Not enough parameters in the syslog (With DEBUG logging level.

This would appear to be the proper format based on the doc. What parameter am I missing here?

Dona21 commented 5 years ago

Hi,

Thanks for pointing out this issue. You're getting a bad result because this part of the README has not been updated to match the full list of requested parameters for /api/graph

This api call requires an additional parameter "display" which can have one of these values "protocols", "sources" or "ports". We will update the READMEas soon as possible.

In your particular case you should append "&display=ports" to the URL. Taking your example, the following should work : http://Flowserver/nfsen-ng/api/graph?datestart=1558137600&dateend=1558191175&type=flows&sources[0]=Router.1&protocols[0]=tcp&ports[0]=80&display=ports

You will notice that I removed part of the URL "&sources[1]=Router.2" because only 1 source or "any" is supported when using the "ports" display. This is somehow prevented if you use the nfsen-ng front-end but it is not if you build your own URL manually.

vantage255 commented 5 years ago

Thank you. Its working great now.