Add build to README, change port, add systemd service

This commit is contained in:
Josh Deprez 2024-08-24 17:34:34 +10:00
parent b5c9ec7523
commit 0be5c6d759
3 changed files with 14 additions and 2 deletions

View file

@ -1,4 +1,6 @@
# lifepo4wered-exporter
Simplistic Prometheus exporter for LiFePO4wered-Pi statistics
TODO: finish writing the readme
```shell
GOOS=linux GOARCH=arm GOARM=6 go build -o lfp-exporter .
```

View file

@ -1,3 +1,4 @@
// The lifepo4wered-exporter binary serves Prometheus metrics based on the output
package main // import "github.com/DrJosh9000/lifepo4wered-exporter"
import (
@ -15,7 +16,7 @@ import (
)
var (
addr = flag.String("listen-address", ":8080", "The address to listen on for HTTP requests.")
addr = flag.String("listen-address", ":9454", "The address to listen on for HTTP requests.")
lifepo4weredVars = prometheus.NewGaugeVec(
prometheus.GaugeOpts{

9
lfp-exporter.service Normal file
View file

@ -0,0 +1,9 @@
[Unit]
Description=LiFePO4wered-Pi+ Prometheus exporter
[Service]
ExecStart=/usr/local/bin/lfp-exporter
Restart=always
[Install]
WantedBy=multi-user.target