Zabbix agent to monitor my mqtt bus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin 771a5ce537 fix readme 1 month ago
Dockerfile add jenkins pipeline, bump zabbix version 1 month ago
Jenkinsfile add jenkins pipeline, bump zabbix version 1 month ago
VERSION add jenkins pipeline, bump zabbix version 1 month ago
build_run.sh add jenkins pipeline, bump zabbix version 1 month ago
mqtt.conf import 1 year ago
readme.md fix readme 1 month ago
readme.txt run 5 months ago

readme.md

Zabbix agent to monitor my MQTT bus

Can monitor mqtt bus for specified message and return value to zabbix.

Sample data from bus:

/device/5C:CF:7F:3D:C3:9F/relay/1/data 0
/device/5C:CF:7F:3D:C3:9F/termo/1/data 10.75
/device/5C:CF:7F:3D:C3:9F/RSSI -66
/device/5C:CF:7F:3D:C3:9F/hostname mod5CCF7F3DC39F
/device/5C:CF:7F:3D:C3:9F/devicename 5C:CF:7F:3D:C3:9F
/device/5C:CF:7F:3D:C3:9F/IP 192.168.1.24
/device/60:01:94:33:FC:3B/relay/1/data 0
/device/60:01:94:33:FC:3B/relay/2/data 1
/device/60:01:94:33:FC:3B/termo/1/data 21.03
/device/60:01:94:33:FC:3B/pressure/1/data 749.46
/device/60:01:94:33:FC:3B/hostname mod60019433FC3B
/device/60:01:94:33:FC:3B/devicename 60:01:94:33:FC:3B
/device/60:01:94:33:FC:3B/IP 192.168.1.146

Set Item key to mqtt[/device/5C:CF:7F:3D:C3:9F/termo/1/data] and you get 10.75.

BUG

Container crush with message

Sending back [ZBX_NOTSUPPORTED: Timeout while executing a shell script.]

means no searched values in mqtt. To fix it set retain for messages or set read timeout for mosquitto_sub with default value.

Settings

Modify mqtt.conf for your own data format.

Set variables and run:

docker run -d --name mqtt-zabbix-agent -e ZBX_SERVER_HOST=zabbix-server-pg -e ZBX_TIMEOUT=10 \
    -e ZBX_HOSTNAME=mqtt-zabbix-agent -e ZBX_ACTIVE_ALLOW=true -e ZBX_PASSIVE_ALLOW=true \
    -e ZBX_DEBUGLEVEL=4 \
    -e MQTTHOST=mqtt-bus -e MQTTPORT=1883 \
    -e MQTTUSER=myhome -e MQTTPASS=longpen1s --restart=always \
    iam21h/mqtt-zabbix-agent