Add build to README, change port, add systemd service
This commit is contained in:
parent
b5c9ec7523
commit
0be5c6d759
3 changed files with 14 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
||||||
# lifepo4wered-exporter
|
# lifepo4wered-exporter
|
||||||
Simplistic Prometheus exporter for LiFePO4wered-Pi statistics
|
Simplistic Prometheus exporter for LiFePO4wered-Pi statistics
|
||||||
|
|
||||||
TODO: finish writing the readme
|
```shell
|
||||||
|
GOOS=linux GOARCH=arm GOARM=6 go build -o lfp-exporter .
|
||||||
|
```
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// The lifepo4wered-exporter binary serves Prometheus metrics based on the output
|
||||||
package main // import "github.com/DrJosh9000/lifepo4wered-exporter"
|
package main // import "github.com/DrJosh9000/lifepo4wered-exporter"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -15,7 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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(
|
lifepo4weredVars = prometheus.NewGaugeVec(
|
||||||
prometheus.GaugeOpts{
|
prometheus.GaugeOpts{
|
||||||
|
|
9
lfp-exporter.service
Normal file
9
lfp-exporter.service
Normal 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
|
Loading…
Reference in a new issue