Simple prometheus exporter and controller for modbus RTU TCP protocol
Modbus device url configuring with doc for modbus library
Simple configuration for RTU via TCP modbus:
device-url: "rtuovertcp://192.168.1.200:8899"
device-id: 16
speed: 19200
timeout: 1s
polling-time: 1s
read-period: 10ms
tags:
- name: "temp_floor"
address: 513
operation: "read_float"
- name: "servo_otopl"
address: 522
operation: "read_uint"$ go buildYou can copy files from ./etc/systemd/ folder to /etc/systemd/system and enable service
$ sudo cp ./etc/systemd/modbus2prometheus.config.yaml
$ sudo systemctl enable modbus2prometheus --nowMetrics exporting to /metrics endpoint. You can scrape metrics with prometheus or vmagent service. Configuration for vmagent in /etc folder