This guide describes how to manually configure a Robustel EG/MG series gateway (running RobustOS Pro) to act as an SNMP collector and MQTT forwarder. By deploying Zabbix Server and Agent 2 via Docker, the gateway can poll data from local end-devices (via SNMP) and forward the processed data to a cloud server via MQTT.
This configuration implements the following data flow:
End Device (SNMP) -> MG460/EG5120 (Zabbix Agent 2) -> MQTT Broker -> Cloud/Server
First, log in to the gateway via SSH and install the necessary system tools and Docker environment.
Bash
ssh username@<Gateway_LAN_IP>(Replace username and <Gateway_LAN_IP> with your actual details).
Switch to root privileges and update the package list.
Bash
sudo -i
apt-get updateInstall Docker engine, Docker Compose, and SNMP utilities required for testing.
Bash
apt-get install -y docker.io docker-compose snmp snmp-mibs-downloader mosquitto-clients python3-pipBash
systemctl start docker
systemctl enable dockerCreate the specific directories required to persist Zabbix database data and store MIB files.
Bash
mkdir -p /zabbix-docker/mibs
mkdir -p /zabbix-docker/data/mysql
mkdir -p /zabbix-docker/alertscriptsEnsure the Docker containers can access these folders.
Bash
chmod -R 755 /zabbix-dockerYou will now create the orchestration file that defines the Zabbix Server, Web Interface, Database, and Agent 2.
Bash
cd /zabbix-dockerdocker-compose.yml file:Use a text editor (like nano or vi) or cat to create the file.
Bash
cat > docker-compose.yml << EOF
version: "3.3"
services:
mysql:
image: docker.1ms.run/library/mysql:8.0
container_name: zabbix-mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_bin
- --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbixpass
volumes:
- ./data/mysql:/var/lib/mysql
restart: unless-stopped
zabbix-server:
image: docker.1ms.run/zabbix/zabbix-server-mysql:latest
container_name: zabbix-server
depends_on:
- mysql
environment:
DB_SERVER_HOST: mysql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbixpass
ZBX_STARTPOLLERS: 10
volumes:
- ./alertscripts:/usr/lib/zabbix/alertscripts
- ./mibs:/usr/share/snmp/mibs
restart: unless-stopped
zabbix-web:
image: docker.1ms.run/zabbix/zabbix-web-nginx-mysql:latest
container_name: zabbix-web
depends_on:
- mysql
- zabbix-server
environment:
DB_SERVER_HOST: mysql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbixpass
PHP_TZ: Asia/Shanghai
ports:
- "8800:8080"
restart: unless-stopped
zabbix-agent2:
image: docker.1ms.run/zabbix/zabbix-agent2:latest
container_name: zabbix-agent2
user: root
depends_on:
- zabbix-server
environment:
ZBX_HOSTNAME: MG460-Gateway
ZBX_SERVER_HOST: zabbix-server
ZBX_PLUGINS: mqtt
ZBX_PLUGIN_MQTT_BROKERS: EMQX_Broker
ZBX_PLUGIN_MQTT_BROKERS_EMQX_BROKER_HOST: broker.emqx.io
ZBX_PLUGIN_MQTT_BROKERS_EMQX_BROKER_PORT: 1883
ZBX_PLUGIN_MQTT_BROKERS_EMQX_BROKER_USERNAME: admin
ZBX_PLUGIN_MQTT_BROKERS_EMQX_BROKER_PASSWORD: admin
ZBX_PLUGIN_MQTT_BROKERS_EMQX_BROKER_TOPICS: zabbix/#
restart: unless-stopped
EOFNote: Modify the MQTT Broker details in the zabbix-agent2 section to match your actual server configuration.
Bash
docker-compose up -dWait approximately 60-90 seconds for the database to initialize, then check the running containers.
Bash
docker-compose psEnsure all four containers (zabbix-mysql, zabbix-server, zabbix-web, zabbix-agent2) are in the Up state.
If your end device requires specific MIB files, upload them to /zabbix-docker/mibs and restart the server container:
Bash
docker-compose restart zabbix-serverVerify the complete data path: End Device -> SNMP -> MG460 -> MQTT.
From the gateway terminal, ensure you can read data from your end device (or a simulator).
Bash
# Replace 192.168.0.96 with your End Device IP
snmpwalk -v 2c -c public 192.168.0.96 .1.3.6.1.4.1http://<Gateway_IP>:8800.Open a second terminal window or use the gateway console to subscribe to the MQTT topic and verify data is arriving.
Bash
mosquitto_sub -h broker.emqx.io -p 1883 -t "zabbix/#" -vYou should see JSON formatted messages published by the Zabbix Agent 2 containing the collected metrics.
/etc/docker/daemon.json.root or using sudo. The docker-compose.yml sets the Agent 2 to run as root to avoid socket permission issues.docker-compose.yml file. Also, ensure the firewall allows outbound traffic on port 1883.Revision | Date | Author | Notes |
v.1.0 | 2026/1/26 | Anson Feng | Initial Release |