NetFlow statistics collection
You can configure the collection of network traffic statistics in a location using the NetFlow protocol and the industry standard sFlow. The statistics are stored in the Clickhouse database (DB) and are available for display in the Grafana monitoring system.
Enabling statistics collection
Via Swagger interface
- In the right-hand menu, click the
icon → Swagger.
- Go to the DCI back section.
Run POST request location/{location_id}/setup. In the request body specify:
Example request body
{"netflow":{"addresses":["192.0.2.100"],"collect_netflow":true,"port":2055,"port_v5":2056,"port_sflow":6343}}
CODEПоясненияaddresses — a list of IP addresses of the location to which the network equipment sends NetFlow/sFlow statistics
port — port for collecting NetFlow v9/v10 (IPFIX) statistics
port_v5 — port for collecting NetFlow v5 statistics
port_sflow — port for collecting sFlow statistics
Через терминал
- Get an authorization token:
curl -X POST 'https://domain.com/auth/v4/public/token' -d '{"email": "admin_email", "password": "admin_pass"}'
CODEComments to the commanddomain.com — domain name or IP address of the server with the platform
admin_email — platform administrator's email
admin_pass — platform administrator's password
In response, you will get the message in the form:
Example of response in JSON
{ "confirmed": true, "id": "6", "token": "4-e9726dd9-61d9-2940-add3-914851d2cb8a" }
CODESave the token value from the received response.
Run the request:
Example request
curl -X POST 'https://domain.com/dci/v3/location/<location_id>/setup' -H 'x-xsrf-token: <token>' -H 'Cookie: ses6=<token>' -H 'isp-box-instance: true' -d '{"netflow":{"addresses":["192.0.2.100"],"collect_netflow":true,"port":2055,"port_v5":2056,"port_sflow":6343}}'
BASHComments to the commanddomain.com — domain name or IP address of the server with the platform
<location_id> — location ID
<token> — authorization token
addresses — a list of IP addresses of the location to which the network equipment sends NetFlow/sFlow statistics
port — port for collecting NetFlow v9/v10 (IPFIX) statistics
port_v5 — port for collecting NetFlow v5 statistics
port_sflow — port for collecting sFlow statistics
When the request is executed, the platform will launch additional docker containers on the location:
- etc_goflow_1 — data collection container;
- flow_msg_queue — temporary storage of the message queue.
The etc_goflow_1 container collects statistics from the equipment and sends them to the flow_msg_queue container. The brokerctl service in the dci_consumer_1 container takes data from the flow_msg_queue container and saves it to the Clickhouse database. The data is stored in the flows table.
Viewing statistics in Grafana
To go to the Grafana interface, in the right-hand menu, click the icon → Grafana.
The statistics are available in dashboards:
- Netflow — full statistics for platform administrators;
- Traffic-netflow-dashboard — statistics on individual servers for users. Each user can see statistics for his own servers only.
Netflow dashboard interface
Platform administrators can export statistical data in CSV format. To do this:
- Go to the NetFlow dashboard → context menu of the Complete data panel → Inspect → Data.
- On Data tab, click Download CSV button.
Diagnostics
etc_goflow_1
Connect to the location via SSH and run the command:
docker logs -f etc_goflow_1
flow_msg_queue
Connect to the location via SSH and run the command:
docker logs -f flow_msg_queue
brokerctl
Connect to the platform server via SSH and run the command:
docker exec -it dci_consumer_1 less -R /var/log/brokerctl.log