项目作者: strzinek

项目描述 :
Influxdb Netflow v5 UDP Collector
高级语言: Go
项目地址: git://github.com/strzinek/gonflux.git
创建时间: 2019-02-01T10:52:28Z
项目社区:https://github.com/strzinek/gonflux

开源协议:MIT License

下载


Minimalist Netflow v5 to influxdb UDP collector written in Go

Broker listens on specified UDP port (2055 by default), accepting Netflow traffic, and collecting records with selected metadata formatted in line protocol to UDP listener of influxdb.

Project includes dockerfile for building runtime application as docker container and also Gitlab CI definition file both for pushing build to docker registry and also for deploying to production docker server.

To enable UDP listener for influxdb, either modify influxd.conf file and add:

  1. [[udp]]
  2. enabled = true
  3. bind-address = ":8089"
  4. database = "db_for_netflow"

or set following environment variables:

  1. INFLUXDB_UDP_ENABLED
  2. INFLUXDB_UDP_BIND_ADDRESS
  3. INFLUXDB_UDP_DATABASE

Netflow data in influxdb can then be analyzed for example with help of Grafana.

BEWARE!!!

The cardinality of general Netflow data is quite high, so to use influxdb effectively for it, I suggest using several retention policies and downsampling the measurements.

PLAN FIRST! ;-)

Usage

  1. gonflux -method udp -out influxdb.local:8089

Supported command line parameters:

  1. -buffer int
  2. Size of RxQueue, i.e. value for SO_RCVBUF in bytes (default 212992)
  3. -in string
  4. Address and port to listen for NetFlow packets (default "0.0.0.0:2055")
  5. -method string
  6. Output method: stdout, udp (default "stdout")
  7. -out string
  8. Address and port of influxdb to send decoded data

Or with docker container:

  1. docker run --name=gonflux -t --restart=always -p 2055:2055/udp -e METHOD='udp' -e OUT='influxdb.local:8089' -d strzinek/gonflux

Credits

This project was created with help of:

Licence

MIT

Copyright (c) 2019 Pavel Strzinek

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.