Index: sysutils/blackbox_exporter/Makefile =================================================================== --- sysutils/blackbox_exporter/Makefile +++ sysutils/blackbox_exporter/Makefile @@ -0,0 +1,28 @@ +# $FreeBSD$ + +PORTNAME= blackbox_exporter +DISTVERSIONPREFIX= v +DISTVERSION= 0.12.0 +CATEGORIES= sysutils + +MAINTAINER= fabian.freyer@physik.tu-berlin.de +COMMENT= Blackbox prober for prometheus + +LICENSE= APACHE20 + +USES= go +USE_GITHUB= yes +USE_RC_SUBR= blackbox_exporter +SUB_FILES= pkg-message +SUB_LIST= GH_TAGNAME=${GH_TAGNAME} + +GH_ACCOUNT= 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 Index: sysutils/blackbox_exporter/distinfo =================================================================== --- sysutils/blackbox_exporter/distinfo +++ sysutils/blackbox_exporter/distinfo @@ -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 Index: sysutils/blackbox_exporter/files/blackbox_exporter.in =================================================================== --- sysutils/blackbox_exporter/files/blackbox_exporter.in +++ sysutils/blackbox_exporter/files/blackbox_exporter.in @@ -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 "nobody". +# blackbox_exporter_group (string): Set group that blackbox_exporter will run under +# Default is "nobody". +# 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:=nobody} +: ${blackbox_exporter_group:=nobody} +: ${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" Index: sysutils/blackbox_exporter/files/pkg-message.in =================================================================== --- sysutils/blackbox_exporter/files/pkg-message.in +++ sysutils/blackbox_exporter/files/pkg-message.in @@ -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". Index: sysutils/blackbox_exporter/pkg-descr =================================================================== --- sysutils/blackbox_exporter/pkg-descr +++ sysutils/blackbox_exporter/pkg-descr @@ -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 Index: sysutils/blackbox_exporter/pkg-plist =================================================================== --- sysutils/blackbox_exporter/pkg-plist +++ sysutils/blackbox_exporter/pkg-plist @@ -0,0 +1,2 @@ +bin/blackbox_exporter +@sample etc/blackbox_exporter.yml.sample