rather basic upsc prometheus exporter
git clone
Log | Files | Refs | README | LICENSE

commit 84d0797fc6ba440296c93fd45145808c91a8ccc9
parent 7f98e5291a9758412497166290b79a1ea58a99fc
Author: Paco Esteban <>
Date:   Fri, 17 Jan 2020 17:26:37 +0100

man page and install target

MMakefile | 7++++++-
Aupsc-exporter.8 | 44++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -1,6 +1,7 @@ BINARY=upsc-exporter VERSION=v0.1.1 +PREFIX=/usr/local BUILD=`git rev-parse --short HEAD` OS=`uname | tr "[:upper:]" "[:lower:]"` ARCH="amd64" @@ -14,8 +15,12 @@ ${BINARY}: main.go GOOS=${OS} GOARCH=${ARCH} CGO_ENABLED=0 GO111MODULE=on \ go build ${LDFLAGS} -tags netgo -o ${BINARY} -.PHONY: clean +.PHONY: clean install clean: rm -rf ${BINARY} +install: ${BINARY} + install -m 0755 ${BINARY} ${PREFIX}/bin/ + install -m 0644 ${BINARY}.8 ${PREFIX}/share/man/man8/ + # vim:ft=make diff --git a/upsc-exporter.8 b/upsc-exporter.8 @@ -0,0 +1,44 @@ +.Dd January 17, 2020 +.Dt UPSC-EXPORTER 8 +.Os +.Sh NAME +.Nm upsc-exporter +.Nd parses nut's +.Xr upsc 8 +data and exports it in prometheus format for scrapping +.Sh SYNOPSYS +.Nm +.Op Fl v +.Op Fl h +.Op Fl p Ar port +.Op Fl ups Ar string +.Sh DESCRIPTION +For each request it gets on /metrics +.Nm +calls +.Xr upsc 8 , +parses its output and responds in prometheus exporter format. +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl v +Prints version and exits. +.It Fl h +Prints help and exits. +.It Fl p Ar port +Port to listen to. +It defaults to 8081 +.It Fl ups Ar string +ups to get info from. +It defaults to +.Dq ups@localhost +.El +.Sh SEE ALSO +.Xr upsc 8 +.Sh AUTHORS +.An Paco Esteban +.Mt +.Sh BUGS +Probably many. +If you find one and want to send a patch, please to so to: +.Mt