Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme: clarify prerequisite packages and require less implicit knowledge to get started #70

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,23 @@ Exporter-->Prometheus:temperature_a{module="VendorXY",sub_target="10"} 20 \ntemp

## Building

Prerequisite packages:
- make
- go (called `golang` at some package managers)

Run:

```bash
make build
```


## Getting Started

The modbus exporter needs to be passed *target* (including port), *module* and *sub_module* as parameters
by Prometheus, this can be done with relabelling (see
[prometheus.yml](prometheus.yml)).
The modbus exporter can be tested standalone, but should be added as a target in your Prometheus config.

Prometheus needs the following labels parsed by the modbus exporter: *target* (including port), *module* and *sub_module* as parameters,
this can be done with relabelling as shown in the example [prometheus.yml](prometheus.yml).

Once Prometheus is properly configured, run the exporter via:

Expand Down Expand Up @@ -86,12 +93,12 @@ Visit http://localhost:9602/metrics to get the metrics of the exporter itself.

## Configuration File

Check out [`modbus.yml`](/modbus.yml) for more details on the configuration file
Check out [`modbus.yml`](modbus.yml) for more details on the configuration file
format.

## Systemd service

You can create a systemd service if you want to run modbus exporter as a service in the background. Start by creating a modbus_exporter system account (example on Debian)
You can create a systemd service if you want to run modbus exporter as a background service. Start by creating a modbus_exporter system account (example on Debian)

```shell
useradd -r modbus_exporter
Expand Down Expand Up @@ -119,14 +126,14 @@ RestartSec=1
WantedBy=multi-user.target
```

Then locate your config file in `/etc/modbus_exporter.yml`, and run the following commands to make systemd aware of config changes and startup the modbus_exporter
Then locate your Modbus exporter config file in `/etc/modbus_exporter.yml`, and run the following commands to make systemd aware of config changes and startup the modbus_exporter

```shell
systemctl daemon-reload
systemctl start modbus_exporter
```

In order to start the service at boot, run the following
In order to start the service at system boot, run the following

```shell
systemctl enable modbus_exporter
Expand Down
Loading