svn commit: r463697 - in head/sysutils: . blackbox_exporter blackbox_exporter/files

Li-Wen Hsu lwhsu at FreeBSD.org
Tue Mar 6 08:28:28 UTC 2018


Author: lwhsu
Date: Tue Mar  6 08:28:27 2018
New Revision: 463697
URL: https://svnweb.freebsd.org/changeset/ports/463697

Log:
  Add sysutils/blackbox_exporter, blackbox prober for prometheus
  
  PR:		226250
  Submitted by:	Fabian Freyer <fabian.freyer at physik.tu-berlin.de>
  Differential Revision:	https://reviews.freebsd.org/D14537

Added:
  head/sysutils/blackbox_exporter/
  head/sysutils/blackbox_exporter/Makefile   (contents, props changed)
  head/sysutils/blackbox_exporter/distinfo   (contents, props changed)
  head/sysutils/blackbox_exporter/files/
  head/sysutils/blackbox_exporter/files/blackbox_exporter.in   (contents, props changed)
  head/sysutils/blackbox_exporter/files/pkg-message.in   (contents, props changed)
  head/sysutils/blackbox_exporter/pkg-descr   (contents, props changed)
  head/sysutils/blackbox_exporter/pkg-plist   (contents, props changed)
Modified:
  head/sysutils/Makefile

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Tue Mar  6 07:49:21 2018	(r463696)
+++ head/sysutils/Makefile	Tue Mar  6 08:28:27 2018	(r463697)
@@ -103,6 +103,7 @@
     SUBDIR += biosfont
     SUBDIR += bkpupsd
     SUBDIR += bksh
+    SUBDIR += blackbox_exporter
     SUBDIR += boxbackup
     SUBDIR += boxbackup-devel
     SUBDIR += brasero

Added: head/sysutils/blackbox_exporter/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/blackbox_exporter/Makefile	Tue Mar  6 08:28:27 2018	(r463697)
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+PORTNAME=	blackbox_exporter
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.12.0
+CATEGORIES=	sysutils
+
+MAINTAINER=	fabian.freyer at physik.tu-berlin.de
+COMMENT=	Blackbox prober for prometheus
+
+LICENSE=	APACHE20
+
+USES=		go
+USE_GITHUB=	yes
+GH_ACCOUNT=	prometheus
+USE_RC_SUBR=	blackbox_exporter
+SUB_FILES=	pkg-message
+SUB_LIST=	GH_TAGNAME=${GH_TAGNAME}
+
+USERS=		prometheus
+GROUPS=		prometheus
+
+GO_PKGNAME=	github.com/${GH_ACCOUNT}/${PORTNAME}
+GO_TARGET=	github.com/${GH_ACCOUNT}/${PORTNAME}
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKDIR}/bin/blackbox_exporter ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${GO_WRKSRC}/example.yml ${STAGEDIR}${PREFIX}/etc/blackbox_exporter.yml.sample
+
+.include <bsd.port.mk>

Added: head/sysutils/blackbox_exporter/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/blackbox_exporter/distinfo	Tue Mar  6 08:28:27 2018	(r463697)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1519753337
+SHA256 (prometheus-blackbox_exporter-v0.12.0_GH0.tar.gz) = 8d5c2236b555af0c1ef00e6973f1aac76a38bbb5220aa6a39c1837a9b29e2a50
+SIZE (prometheus-blackbox_exporter-v0.12.0_GH0.tar.gz) = 2202465

Added: head/sysutils/blackbox_exporter/files/blackbox_exporter.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/blackbox_exporter/files/blackbox_exporter.in	Tue Mar  6 08:28:27 2018	(r463697)
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: blackbox_exporter
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# blackbox_exporter_enable (bool):          Set to NO by default.
+#               Set it to YES to enable blackbox_exporter.
+# blackbox_exporter_user (string):          Set user that blackbox_exporter will run under
+#               Default is "prometheus".
+# blackbox_exporter_group (string):         Set group that blackbox_exporter will run under
+#               Default is "prometheus".
+# blackbox_exporter_args (string):          Set extra arguments to pass to blackbox_exporter
+#               Default is "".
+# blackbox_exporter_listen_address (string):Set ip:port that blackbox_exporter will listen on
+#               Default is "localhost:9115".
+# blackbox_exporter_config_file (string)    Set the location of the blackbox_exporter config
+#                                           configuration file.
+#               Default is "%%PREFIX%%/etc/blackbox_exporter.yml"
+
+. /etc/rc.subr
+
+name=blackbox_exporter
+desc="Blackbox exporter for use with Prometheus"
+rcvar=blackbox_exporter_enable
+
+load_rc_config $name
+
+: ${blackbox_exporter_enable:=NO}
+: ${blackbox_exporter_user:=prometheus}
+: ${blackbox_exporter_group:=prometheus}
+: ${blackbox_exporter_listen_address:=localhost:9115}
+: ${blackbox_exporter_config_file:="%%PREFIX%%/etc/blackbox_exporter.yml"}
+
+pidfile=/var/run/blackbox_exporter.pid
+command=/usr/sbin/daemon
+procname="%%PREFIX%%/bin/blackbox_exporter"
+command_args="-p ${pidfile} /usr/bin/env ${procname} \
+    --web.listen-address=${blackbox_exporter_listen_address} \
+    --config.file=${blackbox_exporter_config_file} \
+    ${blackbox_exporter_args}"
+
+start_precmd=blackbox_exporter_startprecmd
+
+blackbox_exporter_startprecmd()
+{
+    if [ ! -e ${pidfile} ]; then
+        install -o ${blackbox_exporter_user} -g ${blackbox_exporter_group} /dev/null ${pidfile};
+    fi
+}
+
+run_rc_command "$1"

Added: head/sysutils/blackbox_exporter/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/blackbox_exporter/files/pkg-message.in	Tue Mar  6 08:28:27 2018	(r463697)
@@ -0,0 +1,15 @@
+To start blackbox_exporter, create a configuration file at
+%%LOCALBASE%%/etc/blackbox_exporter.yml and run
+"sysrc blackbox_exporter_enable=yes".
+
+For details about the configuration file format, visit
+https://github.com/prometheus/blackbox_exporter/blob/%%GH_TAGNAME%%/CONFIGURATION.md
+
+Since blackbox_exporter allows setting arbitrary probe
+targets via HTTP parameters, it is set to listen on localhost
+only by default. To change the listen address, set the
+blackbox_exporter_listen_address rcvar.
+
+To use the 'ping' module, blackbox_exporter needs to run with
+root privileges. To run blackbox_exporter with root privileges,
+run "sysrc blackbox_exporter_user=root".

Added: head/sysutils/blackbox_exporter/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/blackbox_exporter/pkg-descr	Tue Mar  6 08:28:27 2018	(r463697)
@@ -0,0 +1,5 @@
+blackbox_exporter is a prometheus exporter that allows
+blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP
+and ICMP.
+
+WWW: https://github.com/prometheus/blackbox_exporter

Added: head/sysutils/blackbox_exporter/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/blackbox_exporter/pkg-plist	Tue Mar  6 08:28:27 2018	(r463697)
@@ -0,0 +1,2 @@
+bin/blackbox_exporter
+ at sample etc/blackbox_exporter.yml.sample


More information about the svn-ports-all mailing list