Install SNMP with Docker
Prerequisites
Docker Desktop or Docker Engine must be installed prior to installing the BigPanda agent docker image.
Follow the Docker Installation Guide for your system.
If using
Docker Compose, follow the Install Docker Compose guide to ensure the latest version of compose is installed on your system.Docker Composeis built with the latest version ofDocker Desktop.If using
Docker CLI, ensureDocker CLI's Compose Pluginis installed separately.
Note: If you have issues running any of the docker commands, you either need to run docker with sudo, or add your user to run in the docker group as a non-root user.
Environment Variables
The docker image provides the following environment variables, which can be used to initialize the agent with the appropriate plugin.
BP_TOKEN: Initializes the BigPanda Agent Bearer Token
SNMP_APP_KEY: Initializes the BigPanda Agent Bearer Token
HTTP_PROXY: Adds the proxy settings to bigpanda.conf
FORCE_APP_KEY: Set to
trueto override the existing plugin app keyNAGIOS_APP_KEY: Sets the Nagios App Key and configures the plugin
NAGIOS_USER: Sets the Nagios Username and is required to set up Nagios plugin
ZABBIX_APP_KEY: Sets the Zabbix App Key and configures the plugin
ZENNOSS_APP_KEY: Sets the Zenoss App Key and configures the plugin
ICINGA_APP_KEY: Sets the Icinga App Key and configures the plugin
Pull the BigPanda docker image
Pull the
latestBigPanda agent docker image from the BigPanda JFrog Docker Registry:docker pull bigpandaio-int-docker.jfrog.io/bigpanda-agent:latest
Check that the latest image was downloaded successfully:
docker image ls
Optional:
You can configure a dedicated docker network for the agent. This is useful if you require the agent to communicate with other docker services.
Create the docker network:
docker network create <network-name>
Check that the network was created:
docker network ls
Configure the BigPanda SNMP Agent
If any MIBs are not included by default, they need to be compiled and added manually.
Create a temp container and copy the
compile_mib.shscript to the host machine:docker create --name tmp-agent bigpandaio-int-docker.jfrog.io/bigpanda-agent:latest docker cp tmp-agent:/opt/bigpanda/bigpanda-snmpd/mib_compiler/compile_mib.sh .
Copy the
/etc/bigpanda/snmpddirectory to the host for SNMP configuration:sudo docker cp tmp-agent:/etc/bigpanda/snmpd /etc/bigpanda/snmpd
Optional: You can remove the tmp container created in the previous step:
docker container rm tmp-agent
Run the MIB compiler and output the compiled MIBs to the
snmpd/mibs/directory:./compile_mib.sh --input-directory <path to MIBs> --output-directory /etc/bigpanda/snmpd/conf/
Modify Config Files
For MIBs that are to be monitored, their respective Event Configuration files must be added to the bigpanda-snmpd configuration file:
Edit
/etc/bigpanda/snmpd/snmp-daemon.json, and add the paths to the event_config files to theprocessing.event-configsarray.For example:
sudo vim /etc/bigpanda/snmpd/snmp-daemon.json ... { <snip> "processing": { "mibs-dir": "/etc/bigpanda/snmpd/mibs", "event-configs": [ event_configs/example.json, <ADD EVENT CONFIGS HERE> ], "target-dir": "/var/lib/bigpanda/queue", "stress_test": false } </snip> }
Configure a docker container to work with the SNMPD agent
Run the container in detached mode, passing both
BP_TOKENandSNMP_APP_KEYenvironment variables to docker run.docker run -dit \ --name bp_agent \ -p 5000:5000/udp \ -e BP_TOKEN=<Your Org Bearer Token> \ -e SNMP_APP_KEY=<Your App Key> \ -v agent-configs:/etc/bigpanda \ -v agent-queues:/var/lib/bigpanda \ bigpandaio-int-docker.jfrog.io/bigpanda-agent:latest
View the logs of the running docker container:
docker container logs -f bp_agent
Optional - Docker Compose
Services can be managed via Docker Compose, which requires either the Docker Compose Plugin or the latest Docker Desktop installed.
Create a file called
docker-compose.yml:vim docker-compose.yml
Add the BigPanda agent service configuration to
docker-compose.yml:version: '3.9' services: bp_agent: image: bigpandaio-int-docker.jfrog.io/bigpanda-agent:latest container_name: bp_agent restart: always ports: - 5000:5000/udp environment: - BP_TOKEN=<Your Org Bearer Token> - SNMP_APP_KEY=<Your App Key> volumes: - agent-configs:/etc/bigpanda - agent-queues:/var/lib/bigpanda networks: - bigpanda volumes: agent-configs: agent-queues: networks: bigpanda:Note: Port binding should match the port configured in
/etc/bigpanda/snmpd/snmp-daemon.jsonIt’s important to note that the following commands are based on having Docker Engine 19+ installed, or Docker Desktop installed which has Docker Compose support. If the docker-compose plugin is installed separately, then the command will start with
docker-composevsdocker compose.Bring up the agent container:
docker compose up -d
-dis used to run the container in detached mode.View the logs of the running docker container
docker compose logs -f
You can bring down the container with the
downcommand:docker compose down
Test the Integration
Install SNMP Utils (Debian/Ubuntu):
sudo apt install -y snmp
Send the test SNMP v2 trap:
sudo snmptrap -v 2c -c public 127.0.0.1:5000 1 1.3.6.1.2.1.1 1.3.6.1.2.1.1.5 s "production-switch-1" 1.3.6.1.2.1.1.1 s "SNMP trap test"
Note: Since it is a test message, it won’t be resolved automatically. Click Resolve incident in the BigPanda UI to manually resolve it.
Set up the config file to receive SNMP v3 traps:
Note: Network discovery must be performed to capture the engine id and user details prior to testing SNMP v3.
Add the security object to the snmp config file:
/etc/bigpanda/snmpd/snmp-daemon.json"security": { "local_engine_id": "8000000001020304", "users": [ { "username": "panda", "level": "authPriv", "auth_protocol": "usmHMACSHAAuthProtocol", "privacy_protocol": "usmAesCfb128Protocol", "auth_key": "snmpauthpass123", "privacy_key": "snmpkeypass123", "engine_id": "8000000008675309" }, { "username": "new-panda", "level": "authPriv", "auth_protocol": "usmHMACSHAAuthProtocol", "privacy_protocol": "usmAesCfb128Protocol", "auth_key": "snmpauthpass123", "privacy_key": "snmpkeypass123", "engine_id": "8000000008888888" } ] },Note:
local_engine_idis the local client’s engine id, and can be ommitted. This engine id is generated in memory if not provided.Restart the docker container to pull in the new configuration:
Containers started with docker run:
docker container restart bp_agent
Containers managed with Docker Compose:
docker compose restart
Send an SNMP v3 test trap:
sudo snmptrap -v3 -e 0x8000000008675309 -u panda -l authPriv -a SHA -A snmpauthpass123 -x AES -X snmpkeypass123 127.0.0.1:5000 "" 1.3.6.1.2.1.1 1.3.6.1.2.1.1.5 s "production-switch-v3" 1.3.6.1.2.1.1.1 s "SNMP v3 trap test"