Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written

in Go with pluggable metric collectors.
OK sthen@
This commit is contained in:
claudio 2019-05-08 12:37:09 +00:00
parent 3b7cfab800
commit bd5ec08c88
6 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,42 @@
# $OpenBSD: Makefile,v 1.1.1.1 2019/05/08 12:37:09 claudio Exp $
COMMENT = prometheus exporter for hardware and OS metrics
GH_ACCOUNT = prometheus
GH_PROJECT = node_exporter
GH_TAGNAME = v0.17.0
CATEGORIES = sysutils
HOMEPAGE = http://prometheus.io/
MAINTAINER = Claudio Jeker <claudio@openbsd.org>
# Apache 2.0
PERMIT_PACKAGE_CDROM = Yes
WANTLIB = c pthread
BUILD_DEPENDS = devel/promu
TEST_DEPENDS = shells/bash
USE_GMAKE = Yes
MODULES= lang/go
MODGO_GOPATH= ${MODGO_WORKSPACE}
# promu doesn't like the default PREFIX
do-build:
cd ${WRKSRC} && ${MAKE_ENV} GOMAXPROCS=${MAKE_JOBS} PREFIX=. ${MAKE_PROGRAM} \
PROMU="${LOCALBASE}/bin/promu --config \$$(PROMU_CONF) -v" build
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/node_exporter
${INSTALL_PROGRAM} ${WRKSRC}/node_exporter ${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/LICENSE ${PREFIX}/share/doc/node_exporter/
${INSTALL_DATA} ${WRKSRC}/NOTICE ${PREFIX}/share/doc/node_exporter/
do-test:
cd ${WRKSRC} && ${MAKE_ENV} ${MAKE_PROGRAM} test
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (node_exporter-0.17.0.tar.gz) = djtYi5KCqKpJcob4qxqrYdCFvdLSWM80V/I8YHUsmic=
SIZE (node_exporter-0.17.0.tar.gz) = 1758763

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-Makefile_common,v 1.1.1.1 2019/05/08 12:37:09 claudio Exp $
Index: Makefile.common
--- Makefile.common.orig
+++ Makefile.common
@@ -175,11 +175,7 @@ common-docker-tag-latest:
promu: $(PROMU)
$(PROMU):
- $(eval PROMU_TMP := $(shell mktemp -d))
- curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP)
- mkdir -p $(FIRST_GOPATH)/bin
- cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
- rm -r $(PROMU_TMP)
+ @true
.PHONY: proto
proto:

View File

@ -0,0 +1,2 @@
Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written
in Go with pluggable metric collectors.

View File

@ -0,0 +1,8 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/05/08 12:37:09 claudio Exp $
@newgroup _nodeexporter:834
@newuser _nodeexporter:834:_nodeexporter:daemon:prometheus node_exporter:/nonexistent:/sbin/nologin
@rcscript ${RCDIR}/node_exporter
@bin bin/node_exporter
share/doc/node_exporter/
share/doc/node_exporter/LICENSE
share/doc/node_exporter/NOTICE

View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# $OpenBSD: node_exporter.rc,v 1.1.1.1 2019/05/08 12:37:09 claudio Exp $
daemon="${TRUEPREFIX}/bin/node_exporter"
daemon_user=_nodeexporter
. /etc/rc.d/rc.subr
pexp="${daemon}.*"
rc_bg=YES
rc_reload=NO
rc_start() {
${rcexec} "${daemon} ${daemon_flags} < /dev/null 2>&1 | \
logger -p daemon.info -t node_exporter"
}
rc_cmd $1