-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d17fe45
commit 950173e
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# DHT Sensor Exporter | ||
|
||
Export temperature and humidity readings to [Prometheus](https://prometheus.io/). | ||
|
||
## Usage | ||
|
||
Check the latest release on the [release](https://github.com/vernak2539/dht_sensor_exporter/releases) page to get the link | ||
for the architecture you're wanting (limited selection now). | ||
|
||
```bash | ||
mkdir -p /opt/dht_sensor_exporter | ||
|
||
cd /opt/dht_sensor_exporter | ||
|
||
sudo wget https://github.com/vernak2539/dht_sensor_exporter/releases/download/v0.15.0/dht_sensor_exporter-v0.15.0-linux-armv7 | ||
|
||
sudo mv dht_sensor_exporter-v0.15.0-linux-armv7 dht_sensor_exporter | ||
|
||
sudo chmod +x ./dht_sensor_exporter | ||
``` | ||
|
||
I would suggest setting up a systemd service and running it under it's own user | ||
|
||
**Create User** | ||
|
||
```sh | ||
sudo useradd -M dht_sensor_exporter | ||
sudo chown -R dht_sensor_exporter:root /opt/dht_sensor_exporter | ||
``` | ||
|
||
**Setup systemd** | ||
|
||
```sh | ||
sudo vi /etc/systemd/system/dht_sensor_exporter.service | ||
``` | ||
|
||
Insert following information into service file: | ||
|
||
``` | ||
[Unit] | ||
Description=DHT Sensor Exporter | ||
After=network.target | ||
[Service] | ||
User=dht_sensor_exporter | ||
Type=simple | ||
ExecStart=/opt/dht_sensor_exporter/dht_sensor_exporter | ||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
Run following commands: | ||
|
||
```sh | ||
sudo systemctl daemon-reload | ||
sudo systemctl start dht_sensor_exporter | ||
``` |