Skip to content

Commit

Permalink
Added doc for systemd service config
Browse files Browse the repository at this point in the history
Also updated typo/wording for confirming pwrstat service status.
  • Loading branch information
SILENCE-ETERNAL authored Mar 21, 2022
1 parent 647705f commit d01097f
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Cyberpower UPS Linux daemon (pwrstat) exporter for prometheus

## Installation
Must have Linux PowerPanel application from CyberPower already downloaded (https://www.cyberpowersystems.com/product/software/powerpanel-for-linux/)
And make sure the ``pwrstat.service`` has been staring.
And make sure the ``pwrstat.service`` has been started: `service pwrstat status`

### Build from source
**Please install golang 1.16**
Expand All @@ -25,6 +25,30 @@ Args
sudo pwrstat-exporter --web.listen-address 8088 --web.telemetry-path /metrics
```

## Systemd service
Create the service config
`nano /etc/systemd/system/pwrstat-exporter.service`

```
[Unit]
Description=pwrstat-exporter
[Service]
TimeoutStartSec=0
ExecStart=/usr/local/bin/pwrstat-exporter
[Install]
WantedBy=multi-user.target
```
Restart the systemd daemon, set the service to start on boot, and start the service manually for the first time.

`systemctl daemon-reload`

`systemctl enable pwrstat-exporter`

`service pwrstat-exporter start`

## Dashboard
You can import the dashboard using ``grafana-dashboard.json``
![grafana](/image/grafana.png)

0 comments on commit d01097f

Please sign in to comment.