---
title: Managing the 'network agent' Docker container
source: https://docs.newrelic.com/docs/network-performance-monitoring/advanced/network-agent-container-management
---

This page outlines the options for management of the network agent container used by New Relic's network monitoring.

## Container requirements [#container-requirements]

We recommend the following resources for the network agent container image:

**Disk**

-   100MB available disk space

**CPU**

-   SNMP Polling/Trap Collection: 1 CPU core dedicated for every ~1,000 devices
-   Device Flow Collection: 1 CPU core dedicated for every ~2,000 flows per second (fps)
-   Syslog Message Collection: 1 CPU core dedicated for every ~2,000 messages per second

**Memory**

-   The network agent is not generally constrained by memory resources. The amount of memory on your host should be driven by the types of applications/containers you plan to run. For a general idea, we commonly see success with image sizes as small as the [AWS t2.micro](https://aws.amazon.com/ec2/instance-types/t2/) which has 1 vCPU and 1.0 GB of available RAM.

> #### 💡 TIP
>
> The network agent container image runs a single "job type" at a time. For instance, a container deployed for SNMP polling and trap collection will not be used for flow collection. Furthermore, containers deployed for flow collection are limited to a single `-nf.source` type per container. This means that it is common to have multiple containers deployed to a single Docker host at any given time. They can also share a common configuration file, but do not have to.

## Updating the container [#updating-the-container]

Keeping the network agent container image up to date is good practice to both receive the latest updates and resolve common problems through various bug fixes applied during the development lifecycle. It is recommended to always pull the latest available image when redeploying your containers.

1.  Pull the latest container image from [Docker Hub](https://hub.docker.com/):

    ```shell
    docker pull newrelic/network-agent:latest
    ```

2.  Collect the IDs and names of any existing containers:

    ```shell
    docker ps -a --filter ancestor=newrelic/network-agent:latest --format "{{.ID}} - {{.Names}}"
    ```

    Output Example:

    ```
    3297b134a352 - network-agent-snmp
    4962a854b386 - network-agent-sflow
    ```

3.  Remove any pre-existing containers

    ```shell
    docker rm -f $CONTAINER_ID
    ```

4.  Redeploy your network agent container using the original settings you deployed with from either [SNMP](https://docs.newrelic.com/docs/network-performance-monitoring/setup-performance-monitoring/snmp-performance-monitoring), [flow data](https://docs.newrelic.com/docs/network-performance-monitoring/setup-performance-monitoring/network-flow-monitoring), or [syslog collection](https://docs.newrelic.com/docs/network-performance-monitoring/setup-performance-monitoring/network-syslog-monitoring).

> #### ⚠️ IMPORTANT
>
> The configuration file used by the network agent is applied to the container at runtime. Changes to this file require you to remove and restart your running container(s) to apply the edits, with the exception of using integrated discovery jobs.

## Container runtime options [#container-runtime-options]

Below are the various options available during Docker runtime for the network agent container image:

| Option name                                                                                                                                           | Type                 | Required                  | Description                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-snmp`                                                                                                                                               | Flag                 | ✓                         | Sets the path to the `snmp-base.yaml` file on the Docker container, based on the volume mount from the Docker host passed as an option during runtime.                                                                                                                                                                                                                       |
| `-nr_account_id`                                                                                                                                      | Flag                 | ✓                         | The New Relic account ID that the network agent will ship data to.                                                                                                                                                                                                                                                                                                           |
| `-log_level`                                                                                                                                          | Flag                 |                           | Overrides the default **info** log level for the network agent. The available options are `debug`, `info`, `warn`, or `error`.                                                                                                                                                                                                                                               |
| `-snmp_discovery`                                                                                                                                     | Flag                 |                           | Used to setup the container in SNMP discovery mode to run a single discovery job, update the provided YAML configuration file, and exit.                                                                                                                                                                                                                                     |
| `-snmp_discovery_min`                                                                                                                                 | Flag                 |                           | Used to setup **integrated discovery jobs** within the SNMP polling container scheduled to run at a fixed interval. This setting will execute the discovery job, update the provided YAML configuration file, and then restart the SNMP collection threads on the SNMP polling container to remove the need to destroy/restart your entire container for discovered devices. |
| `-snmp_discovery_on_start`                                                                                                                            | Flag                 |                           | When combined with the `-snmp_discovery_min` flag being set, the network agent will immediately run a discovery job on container start, in addition to every X minutes as defined by `-snmp_discovery_min`. This flag has no effect if `-snmp_discovery_min` is not set.                                                                                                     |
| `-snmp_poll_now`                                                                                                                                      | Flag                 |                           | Used to setup the container to poll a target device on-demand.                                                                                                                                                                                                                                                                                                               |
| `-tee_logs`                                                                                                                                           | Flag                 |                           | Forwards Docker logs from the network agent into New Relic Logs.                                                                                                                                                                                                                                                                                                             |
| `-metrics=jchf`                                                                                                                                       | Flag                 |                           | Forwards health metrics from the network agent into New Relic.                                                                                                                                                                                                                                                                                                               |
| `-service_name`                                                                                                                                       | Flag                 |                           | Appended to the container name in Docker logs to help isolate logs from various containers in New Relic Logs.                                                                                                                                                                                                                                                                |
| `-nr_region`                                                                                                                                          | Flag                 |                           | Sets the regional API endpoints for the network agent to forward telemetry to New Relic. Options are `US`, `EU`, and `GOV` (FedRAMP).                                                                                                                                                                                                                                        |
| `-max_threads`                                                                                                                                        | Flag                 |                           | Lets you process higher volumes of data. We recommend one CPU core available for every 2,000 flows per second (fps) of network flow data sent, or every 1,000 SNMP devices being monitored, or every 2,000 syslog messages per second collected by a container. The default is `1`.                                                                                          |
| `-sample_rate`                                                                                                                                        | Flag                 |                           | Changes the default sample rate value at which flows are passed to New Relic events. This does not speed up the local configuration of flow sample rate on a device, but it can slow it down. Setting this to `1` will enable capturing all flows sent to the container. The default is `1000`.                                                                              |
| `-nf.workers`                                                                                                                                         | Flag                 |                           | Overrides the number of workers used in processing network packets. Use one worker for every 4,000 of flows per second (fps) of network flow data sent. The default is `2`.                                                                                                                                                                                                  |
| `-nf.port`                                                                                                                                            | Flag                 |                           | Overrides the listening port for incoming flow packets. The default is `9995`.                                                                                                                                                                                                                                                                                               |
| `-nf.source`                                                                                                                                          | Flag                 |                           | Sets up the type of flow this container will process. Options are `auto`, `asa`, `ipfix`, `nbar`, `netflow5`, `netflow9`, `pan`, and `sflow`.                                                                                                                                                                                                                                |
| `-application_map`                                                                                                                                    | Flag                 |                           | Sets the path to an [application map](https://docs.newrelic.com/docs/network-performance-monitoring/setup-performance-monitoring/advanced-config) file on the Docker container, based on a volume mount from the Docker host passed as an option during runtime.                                                                                                             |
| `-dns`                                                                                                                                                | Flag                 |                           | Sets the `IP:Port` for the network agent to use during DNS resolution of IP addresses. Setting this affects the results for the `dst_host` and `src_host` fields.                                                                                                                                                                                                            |
| `nr1.flow`                                                                                                                                            | Argument             | ✓ (For flow containers)   | This argument statically sets the following flags: `compression: gzip`, `sink: new_relic`, `format: new_relic`, `max_before_sample: 100`, `flow_only: true`, `nf.source: auto`.                                                                                                                                                                                              |
| `nr1.snmp`                                                                                                                                            | Argument             | ✓ (For SNMP containers)   | This argument statically sets the following options: `compression: gzip`, `sink: new_relic`, `format: new_relic_metric`, `max_flows_per_message: 100`.                                                                                                                                                                                                                       |
| `nr1.syslog`                                                                                                                                          | Argument             | ✓ (For syslog containers) | This argument statically sets the following flags: `compression: gzip`, `sink: new_relic`, `format: new_relic_metric`, `syslog:"0.0.0.0:5143"`.                                                                                                                                                                                                                              |
| `-syslog.format`                                                                                                                                      | Flag                 |                           | Format to parse syslog messages with. Options are `Automatic|RFC3164|RFC5424|RFC6587|NoFormat`. Default: `Automatic`. _`NoFormat` must be explicitly set to handle messages that do not conform to RFC standards._                                                                                                                                                           |
| `-syslog.source`                                                                                                                                      | Flag                 |                           | IP:Port tuple to run the Syslog server on. Default: `0.0.0.0:5143`                                                                                                                                                                                                                                                                                                           |
| `NEW_RELIC_API_KEY`                                                                                                                                   | Environment Variable | ✓                         | Environment variable that must be used during Docker runtime to hold the New Relic license key for the network agent to send data to the New Relic APIs. Ex: `-e NEW_RELIC_API_KEY=$LICENSE_KEY`.                                                                                                                                                                            |
| `HTTPS_PROXY`                                                                                                                                         | Environment Variable |                           | Environment variable that can be used during Docker runtime to setup the network agent to ship data to New Relic via proxy. Ex: `-e HTTPS_PROXY=https://user:password@hostname:port`.                                                                                                                                                                                        |
| `KENTIK_PING_PRIV`                                                                                                                                    | Environment Variable |                           | Environment variable that can be used during Docker runtime to setup the network agent's `response_time` \| `ping_only` configuration to use UDP packets used in unprivileged mode instead of the default privileged mode for ICMP packets. Default: `true`                                                                                                                  |
| `KENTIK_MERAKI_API_KEY`                                                                                                                               | Environment Variable |                           | Environment variable that can be used during Docker runtime to pass the [Meraki Dashboard API key](https://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API#Enable_API_Access) into the network agent. Ex: `-e KENTIK_MERAKI_API_KEY=$DASHBOARD_API_KEY`.                                                                             |
| [Various Cloud Provider Environment Variables](https://docs.newrelic.com/docs/network-performance-monitoring/advanced/advanced-config/#cloud-secrets) | Environment Variable |                           | Environment variables that can be used during Docker runtime to retrieve secrets from AWS, Azure, or GCP.                                                                                                                                                                                                                                                                    |
