1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

Add sysutils/blackbox_exporter, blackbox prober for prometheus

PR:		226250
Submitted by:	Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Differential Revision:	https://reviews.freebsd.org/D14537
This commit is contained in:
Li-Wen Hsu 2018-03-06 08:28:27 +00:00
parent 9b6544ce6c
commit 06394c8b1f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=463697
7 changed files with 113 additions and 0 deletions

View File

@ -103,6 +103,7 @@
SUBDIR += biosfont
SUBDIR += bkpupsd
SUBDIR += bksh
SUBDIR += blackbox_exporter
SUBDIR += boxbackup
SUBDIR += boxbackup-devel
SUBDIR += brasero

View File

@ -0,0 +1,30 @@
# $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
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>

View File

@ -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

View File

@ -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"

View File

@ -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".

View File

@ -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

View File

@ -0,0 +1,2 @@
bin/blackbox_exporter
@sample etc/blackbox_exporter.yml.sample