Skip to content

kefalle/modbus2prometheus

Repository files navigation

modbus2prometheus

Simple prometheus exporter and controller for modbus RTU TCP protocol

Configuring

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"

Build

$ go build

Install as service

You 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 --now

Scraping metrics

Metrics exporting to /metrics endpoint. You can scrape metrics with prometheus or vmagent service. Configuration for vmagent in /etc folder

About

modbus to prometheus exporter and controller

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages