You can use our guided install process to install the network flow monitoring agent, or install the agent manually. This doc covers prerequisites to start this install process and a step-by-step walk through of your install options.
Prerequisites
Before you can start, you'll need to sign up for a New Relic account. If you choose to install the agent manually, you also need:
If you're using Linux to install the agent as a service, you'll need:
SSH access to the host
Access to install/remove applications and services
One of these supported operating systems:
CentOS 8
Debian 12 (Bookworm)
Debian 11 (Bullseye)
Debian 10 (Buster)
RedHat Enterprise Linux 9
Ubuntu 20.04 (Focal LTS)
Ubuntu 22.04 (Jammy LTS)
Ubuntu 23.04 (Lunar)
You must configure source devices to send flow data to the host running the network monitoring agent. Here's how to configure network flow export in some devices (this is not an all-inclusive list):
Network flow monitoring supports the four primary types of network flow data and their derivatives. When running the agent, you can specify which major type you want to monitor using the -nf.source option.
Tip
Collection of NetFlow v5, NetFlow v9, sFlow, and IPFIX templates can all be handled using -nf.source.=auto on a single agent. This is enabled as a default setting when using the nr1.flow argument at runtime.
Network flow type
Enabled with auto?
-nf.source value
AppFlow
✓
auto | netflow5
Argus
✓
auto | netflow5
Cisco ASA
asa
Cisco NBAR
nbar
cflowd
✓
auto | netflow5
IPFIX
✓
auto | ipfix
J-Flow
✓
auto | netflow5
NetFlow v5
✓
auto | netflow5
NetFlow v9
✓
auto | netflow9
NetStream
✓
auto | netflow5
Palo Alto Networks
pan
RFlow
✓
auto | netflow5
sFlow
✓
auto | sflow
When should you scale network flow collection?
When planning your strategy for collecting network flows at scale, the following items should be considered:
The ktranslate agent can only perform a single job at a time. An agent running SNMP collection cannot also listen for network flows.
The ktranslate agent can only listen for incoming network flows on a single listening port at a time (default: 9995). If you require multiple ports to be open, each requires a dedicated agent, using the -nf.port configuration option at runtime to change the port.
The default -nf.source=auto configuration allows the container to listen for multiple standard flow types. If you need to parse other types of flow data like Cisco ASA, Cisco NBAR, or Palo Alto Networks templates, each will require their own agent.
New Relic recommends 1 CPU per 2000 flows-per-second (120,000 flows-per-minute). Deciding whether to horizontally scale multiple agents to distribute load or vertically scale a few larger agents to consolidate management is a matter of personal preference.
Set up network flow data monitoring
For most use cases, we recommended our guided install to set up network flow data monitoring. If your set up is more advanced with custom configurations, then we'd recommend installing manually.
Copy the snmp-base.yaml file to the local $HOME directory of your Docker user, and discard the container by running:
bash
$
cd ~
$
id=$(docker create kentik/ktranslate:v2)
$
dockercp$id:/etc/ktranslate/snmp-base.yaml .
$
dockerrm-v$id
Edit the snmp-base.yaml file, and add your network flow devices inside the devices dictionary key with the following structure:
devices:
# This key and the corresponding 'device_name'
# need to be unique for each device
flow_device1:
device_name: flow_device1
device_ip: x.x.x.x/yy
flow_only:true
# Optional user tags
user_tags:
owning_team: net_eng
environment: production
Important
If you're already monitoring SNMP data devices that will also send network flows, you'll want to ensure that the value for device_name is identical for both configuration files to ensure the flow telemetry is attributed to the right entity in the New Relic UI.
Run ktranslate to listen for network flows with the command:
bash
$
docker run -d--name ktranslate-$CONTAINER_SERVICE--restart unless-stopped --pull=always --net=host \
>
-v`pwd`/snmp-base.yaml:/snmp-base.yaml \
>
-eNEW_RELIC_API_KEY=$YOUR_NR_LICENSE_KEY\
>
kentik/ktranslate:v2 \
>
-snmp /snmp-base.yaml \
>
-nr_account_id=$YOUR_NR_ACCOUNT_ID\
>
-metrics=jchf \
>
-tee_logs=true \
>
# Use this field to create a unique value for `tags.container_service` inside of New Relic
>
-service_name=$CONTAINER_SERVICE\
>
-flow_only=true \
>
nr1.flow
Investigate your network flow data in the New Relic UI.
On a host with Podman installed, download the ktranslate image by running the following command:
Copy the snmp-base.yaml file to the local $HOME directory of your Podman user, and discard the container by running:
bash
$
cd ~
$
id=$(podman create kentik/ktranslate:v2)
$
podmancp$id:/etc/ktranslate/snmp-base.yaml .
$
podmanrm-v$id
Edit the snmp-base.yaml file, and add your network flow devices inside the devices dictionary key with the following structure:
devices:
# This key and the corresponding 'device_name'
# need to be unique for each device
flow_device1:
device_name: flow_device1
device_ip: x.x.x.x/yy
flow_only:true
# Optional user tags
user_tags:
owning_team: net_eng
environment: production
Important
If you're already monitoring SNMP data devices that will also send network flows, you'll want to ensure that the value for device_name is identical for both configuration files to ensure the flow telemetry is attributed to the right entity in the New Relic UI.
Run ktranslate to listen for network flows with the command:
bash
$
podman run -d--name ktranslate-$CONTAINER_SERVICE--userns=keep-id --restart unless-stopped --pull=always --net=host \
>
-v`pwd`/snmp-base.yaml:/snmp-base.yaml \
>
-eNEW_RELIC_API_KEY=$YOUR_NR_LICENSE_KEY\
>
kentik/ktranslate:v2 \
>
-snmp /snmp-base.yaml \
>
-nr_account_id=$YOUR_NR_ACCOUNT_ID\
>
-metrics=jchf \
>
-tee_logs=true \
>
# Use this field to create a unique value for `tags.container_service` inside of New Relic
>
-service_name=$CONTAINER_SERVICE\
>
-flow_only=true \
>
nr1.flow
Tip
Rootless Podman containers aren't able to bind to ports under 1024. If your network flows are sent on a port under 1024 instead of the default (9995), you'll need to create an iptables rule to handle packet redirection with the command:
If you don't have an existing snmp-base.yaml configuration file, create one with:
bash
$
cd ~
$
touch snmp-base.yaml
Edit the snmp-base.yaml file, and add your network flow devices inside the devices dictionary key with the following structure:
devices:
# This key and the corresponding 'device_name'
# need to be unique for each device
flow_device1:
device_name: flow_device1
device_ip: x.x.x.x/yy
flow_only:true
# Optional user tags
user_tags:
owning_team: net_eng
environment: production
Restart the ktranslate service to apply your changes to the snmp-base.yaml file:
bash
$
sudo systemctl restart ktranslate
Investigate your network flow data in the New Relic UI.
Find and use your metrics
All network flow logs exported from the ktranslate container use the KFlow namespace, via the New Relic Event API. Currently, these are the default fields populated from this integration:
Attribute
Type
Description
application
String
The class of program generating the traffic in this flow record. This is derived from the lowest numeric value from l4_dst_port and l4_src_port. Common examples include http, ssh, and ftp.
device_name
String
The display name of the sampling device for this flow record.
The target IP:Port tuple for this flow record. This is a combination of dst_addr and l4_dst_port.
dst_geo
String
The target country for this flow record, if known.
in_bytes
Numeric
The number of bytes transferred for ingress flow records.
in_pkts
Numeric
The number of packets transferred for ingress flow records.
input_port
Numeric
If_Index value for the interface at the source of this flow record.
l4_dst_port
Numeric
The target port for this flow record.
l4_src_port
Numeric
The source port for this flow record.
output_port
Numeric
If_Index value for the interface at the destination of this flow record.
protocol
String
The display name of the protocol used in this flow record, derived from the [numeric IANA protocol number](https://www.iana.org/assignments/ protocol-numbers/protocol-numbers.xhtml).
provider
String
This attribute is used to uniquely identify various sources of data from ktranslate. Network flow logs will always have the value of kentik-flow-device.
sample_rate
Numeric
Sampling rate applied by either the sampling device configuration, or the sample_rate argument in ktranslate.