netbeez/nb-agent

By netbeez

Updated 8 days ago

NetBeez Containerized Agent

Image
1

1M+

netbeez/nb-agent repository overview

alt text


New Features/Breaking Changes:
  • v13.0.2: Ability to set root password for container using NB_ROOT_PASSWD env
  • v3.3.0 and after uses a different configuration format.
    • You will need to delete any configuration volumes to use the new format.

The nb-agent image includes a fully loaded NetBeez Beez agent that you can deploy in your container management environment. The Beez agent can perform network tests, such as Ping, DNS, HTTP, Traceroute, Path Analysis as well as Iperf, Speedtest and VoIP. You can find out more information about the NetBeez Network Monitoring solution at our website: https://netbeez.net

You can request a demo of the NetBeez Beezkeeper dashboard here: https://netbeez.net/#request-form

Usage


Here are some example snippets to you get you started running the containerized agent.

Parameters
Automatic Setup
ParameterFunction
-e "NB_SECRET_KEY=<secret key>"Used for the automatic setup of the agent. This is found on the Settings of your dashboard.
-v <volume>:/etc/netbeez/persistence/:rwUsed to persist automatic setup configuration.
Manual Setup/Additional Parameters
ParameterFunction
-e "HOST=<FQDN>"FQDN of your NetBeez dashboard.
-e "INTERFACES=<interface>"The interface that the agent will operate on. Depending on your docker networks changing this may be necessary in certain cases. Default interface is eth0.
-e "SECURE_PORT=<port>"Only required if you have requested a port change for your agents. Default port is 20018.
-e "AGENT_UUID=<uuid>"A unique identifier for your agent. Required for agent to appear as the same unique agent on the dashboard.
-e "NB_ROOT_PASSWD=<root_password>"Custom root password for the container.
-e "http_proxy=<proxy address>:<port>"The HTTP proxy address and port.
-e "https_proxy=<proxy address>:<port>"The HTTPS proxy address and port.
--mac-address="<mac address>"Required if you are running multiple Docker agents from different hosts to the same dashboard. Each of the agents will need a unique MAC address.
-v <volume>:/etc/netbeez/persistence/netbeez-agent.pem:rw (Recommended)

--OR--

-e "NETBEEZ_PEM=-----BEGIN CERTIFICATE-----\nxxx\nxxx\nxxx\n-----END CERTIFICATE-----"
NetBeez certificate can be stored and used in a volume, which is the recommended way, or passed as an environment variable. Please contact NetBeez support to get the certificate compatible with your NetBeez dashboard.
--restart=alwaysAlways restart the container if it stops.
--network hostIn host mode the container’s network stack is not isolated from the Docker host: the container shares the host’s networking namespace. The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.
Docker Run

If you decide to use a volume to store the agent configuration then first create a docker volume.

docker volume create netbeez-config-vol
Automatic Setup
docker run -d --restart=always -e "NB_SECRET_KEY=xxx" -v netbeez-config-vol:/etc/netbeez/persistence/:rw netbeez/nb-agent
Generated MAC & UUID
docker run -d --restart=always --mac-address="02:42:$(openssl rand -hex 4 | sed 's/\(..\)/\1:/g; s/.$//')" -e "AGENT_UUID=$(uuidgen | tr -d - | tr -d '\n' | tr '[:upper:]' '[:lower:]')" -e "NB_SECRET_KEY=xxx" -v netbeez-config-vol:/etc/netbeez/persistence/:rw netbeez/nb-agent
Manual Setup
docker run -d --restart=always -e "HOST=<FQDN>" -v netbeez-config-vol:/etc/netbeez/persistence/netbeez-agent.pem:rw netbeez/nb-agent
Docker Compose
Automatic Setup
version: "2.4"
services:
  nb-agent:
    image: netbeez/nb-agent
    container_name: nb-agent
    env_file:
      - /path/to/file.env
    restart: always
    volumes:
      - netbeez-config-vol:/etc/netbeez/persistence/:rw
volumes:
  netbeez-config-vol:
Manual Setup
version: "2.4"
services:
  nb-agent:
    image: netbeez/nb-agent
    container_name: nb-agent
    environment:
      - "HOST=<FQDN>"
      - "AGENT_UUID=<uuid>"
    restart: always
    volumes:
      - netbeez-config-vol:/etc/netbeez/persistence/netbeez-agent.pem:rw
volumes:
  netbeez-config-vol:
Setting environment variables with .env file

Instead of setting plain-text environment variables, a env-file can be used. In docker run, pass in --env-file=/path/to/file.env that set the desired environment variables. In the docker compose, a similar file can be passed, or a env_file can be set in the .yml file. See Docker documentation for more information.

Example .env file
NB_SECRET_KEY=<secret key>
NB_ROOT_PASSWD=<custom root password>
Limiting Access in Container using CAP_DROP

To limit access within the NetBeez Docker container, you can utilize cap_drop with docker compose. The NetBeez Docker agent requires low-level access, but some capabilites may be able to be dropped if desired. See Docker documentation and available capabilities.

Generate MAC Addresses

--mac-address="02:42:$(openssl rand -hex 4 | sed 's/\(..\)/\1:/g; s/.$//')"

Generate UUID

-e "AGENT_UUID=$(uuidgen | tr -d - | tr -d '\n' | tr '[:upper:]' '[:lower:]')"

Tag summary

Content type

Image

Digest

sha256:856213f78

Size

273 MB

Last updated

8 days ago

docker pull netbeez/nb-agent