Prometheus exporter for the DHT11 sensor.
Find a file
finga 9a7f202f85
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Create the exporter
2022-05-07 22:01:45 +02:00
.cargo Create the exporter 2022-05-07 22:01:45 +02:00
debian Create the exporter 2022-05-07 22:01:45 +02:00
src Create the exporter 2022-05-07 22:01:45 +02:00
.gitignore Create the exporter 2022-05-07 22:01:45 +02:00
.woodpecker.yml Create the exporter 2022-05-07 22:01:45 +02:00
Cargo.lock Create the exporter 2022-05-07 22:01:45 +02:00
Cargo.toml Create the exporter 2022-05-07 22:01:45 +02:00
README.md Create the exporter 2022-05-07 22:01:45 +02:00

Exporter for the DHT11 sensor status-badge

A Prometheus exporter for the DHT11 sensor.

Build

Cargo, the Rust package manager, is used to build this project.

Same architecture as system

Compile it for the same architecture as the build system:

cargo build --release

Cross-compile for amd64 (recent RaspberryPi)

Cross-compile it for the amd64 architecture:

PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --target aarch64-unknown-linux-gnu --release

Debian

To build a package for Debian, Raspbian, and so on, cargo-deb can be used.

The package comes with an automatically started and enabled systemd service unit which can be configured via /etc/default/dht11-exporter.

Same architecture as system

Build a deb package for the same architecture as the build system:

cargo deb

Cross-compile for amd64 (recent RaspberryPi)

Build a deb package for the amd64 architecture:

PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo deb --target aarch64-unknown-linux-gnu

Usage

USAGE:
    dht11-exporter [OPTIONS]

OPTIONS:
    -a, --address <ADDRESS>    The IPv4 or IPv6 address where the metrics are served [default:
                               127.0.0.1]
    -g, --gpio <GPIO>          The GPIO pin of the DHT11 data line [default: 4]
    -h, --help                 Print help information
    -p, --port <PORT>          The port where the metrics are served [default: 9112]
    -V, --version              Print version information