How to Deploy Zabbix for SNMP to MQTT Data Forwarding on EG/MG Series

How to Deploy Zabbix for SNMP to MQTT Data Forwarding on EG/MG Series

Overview

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

What You'll Need

Hardware

  • 1 x Robustel EG/MG Series Gateway (e.g., MG460, EG5120) with ARM64 architecture.
  • 1 x Power supply.
  • 1 x Ethernet cable connecting the gateway to the WAN/Internet.
  • 1 x End Device (e.g., PLC, Marine VSAT) supporting SNMP connected to the Gateway's LAN.

Software/Firmware

  • RobustOS Pro firmware (Debian 11 based).
  • SSH Client (e.g., PuTTY, SecureCRT).
  • Internet access on the gateway (for downloading Docker images and packages).

Prerequisites

Step-by-Step Configuration Guide

Step 1: Access the Gateway and Install Dependencies

First, log in to the gateway via SSH and install the necessary system tools and Docker environment.

  1. Login via SSH:

Bash

ssh username@<Gateway_LAN_IP>

(Replace username and <Gateway_LAN_IP> with your actual details).

  1. Update System and Install Tools:

Switch to root privileges and update the package list.

Bash

sudo -i
apt-get update
  1. Install Docker and SNMP Utils:

Install 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-pip
  1. Start Docker Service:

Bash

systemctl start docker
systemctl enable docker

Step 2: Configure Directory Structure

Create the specific directories required to persist Zabbix database data and store MIB files.

  1. Create Directories:

Bash

mkdir -p /zabbix-docker/mibs
mkdir -p /zabbix-docker/data/mysql
mkdir -p /zabbix-docker/alertscripts
  1. Set Permissions:

Ensure the Docker containers can access these folders.

Bash

chmod -R 755 /zabbix-docker

Step 3: Create Docker Compose Configuration

You will now create the orchestration file that defines the Zabbix Server, Web Interface, Database, and Agent 2.

  1. Navigate to the directory:

Bash

cd /zabbix-docker
  1. Create the docker-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
EOF

Note: Modify the MQTT Broker details in the zabbix-agent2 section to match your actual server configuration.

Step 4: Deploy and Verify Services

  1. Launch Containers:

Bash

docker-compose up -d
  1. Verify Status:

Wait approximately 60-90 seconds for the database to initialize, then check the running containers.

Bash

docker-compose ps

Ensure all four containers (zabbix-mysql, zabbix-server, zabbix-web, zabbix-agent2) are in the Up state.

  1. Import MIBs (Optional):

If your end device requires specific MIB files, upload them to /zabbix-docker/mibs and restart the server container:

Bash

docker-compose restart zabbix-server

Step 5: Validation and Testing

Verify the complete data path: End Device -> SNMP -> MG460 -> MQTT.

  1. Test SNMP Reachability:

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.1
  1. Access Zabbix Web Interface:
    • Open a browser and go to http://<Gateway_IP>:8800.
    • Username: Admin
    • Password: zabbix
    • Navigate to Configuration > Hosts and ensure the "MG460-Gateway" (Agent 2) is available. You can add SNMP interfaces here to poll the End Device.
  1. Monitor MQTT Output:

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/#" -v

You should see JSON formatted messages published by the Zabbix Agent 2 containing the collected metrics.

Troubleshooting / FAQ

  • Q: Docker fails to pull images.
    • A: Check the gateway's internet connection. If the default registry is blocked, you may need to configure a Docker mirror in /etc/docker/daemon.json.
  • Q: "Permission denied" errors.
    • A: Ensure you are running commands as root or using sudo. The docker-compose.yml sets the Agent 2 to run as root to avoid socket permission issues.
  • Q: I cannot see data in the MQTT broker.
    • A: Verify the MQTT credentials in the docker-compose.yml file. Also, ensure the firewall allows outbound traffic on port 1883.

Revision History

Revision

Date

Author

Notes

v.1.0

2026/1/26

Anson Feng

Initial Release

    • Related Articles

    • How to Deploy Zabbix and SNMP Data Simulation via MQTT on RobustOS Pro

      Overview When using Robustel's EG series gateways (such as the MG460) running RobustOS Pro, users may need to monitor end-device data using Zabbix via SNMP and MQTT protocols. This comprehensive deployment solution bridges end-devices to a Zabbix ...
    • How to Read S6000U Data via EG5120 and Send to Blynk Cloud by MQTT

      1. Overview This guide outlines the integration of the S6000U multi-sensor (Temperature, Humidity, Light, Noise, etc.) with the Blynk Cloud platform via the Robustel EG5120 Industrial Edge Gateway. Architecture: Field Layer: The S6000U sensor ...
    • How to install the MQTT broker service on EG series devices?

      Overview This article provides a step-by-step guide for installing and configuring the Mosquitto MQTT broker on a Robustel EG series gateway (e.g., EG5120, EG5200) running RobustOS Pro. This setup is ideal for scenarios where you need a reliable, ...
    • How to Update EG Series Device via USB

      This guide explains how to update your EG Series/RobustOS Pro device using a USB drive with the firmware package mg460-uuu-udisk-upgrade-2.1.5.tgz. Here take MG460 for example. ⚠️ Important Warning CAUTION: This process will restore the device to ...
    • How to Install Node-RED on EG Series Devices via Docker?

      ? Overview This document outlines the procedure for deploying Node-RED on Robustel EG Series Edge Gateways. Node-RED is a flow-based programming tool, originally developed by IBM, which allows for visual programming to wire together hardware ...