Initial commit
This commit is contained in:
commit
f89a1e29a9
41
Makefile
Normal file
41
Makefile
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Created by: Athanasios Douitsis <aduitsis@cpan.org>
|
||||||
|
# $FreeBSD: head/sysutils/unbound_exporter/Makefile 519502 2019-12-08 17:25:38Z dmgk $
|
||||||
|
|
||||||
|
PORTNAME= unbound_exporter
|
||||||
|
PORTVERSION= 0.3
|
||||||
|
DISTVERSIONPREFIX= v
|
||||||
|
PORTREVISION= 1
|
||||||
|
CATEGORIES= sysutils
|
||||||
|
|
||||||
|
MAINTAINER= johan@nosd.in
|
||||||
|
COMMENT= Prometheus metrics exporter for the Unbound DNS resolver
|
||||||
|
|
||||||
|
LICENSE= APACHE20
|
||||||
|
|
||||||
|
USES= go
|
||||||
|
USE_GITHUB= yes
|
||||||
|
GH_ACCOUNT= kumina
|
||||||
|
GH_PROJECT= unbound_exporter
|
||||||
|
|
||||||
|
USERS= unbound
|
||||||
|
GROUP= unbound
|
||||||
|
|
||||||
|
GH_TUPLE= prometheus:client_golang:3fb53d:client_golang/vendor/github.com/prometheus/client_golang \
|
||||||
|
prometheus:client_model:6f38060:client_model/vendor/github.com/prometheus/client_model \
|
||||||
|
prometheus:common:49fee29:common/vendor/github.com/prometheus/common \
|
||||||
|
prometheus:procfs:a1dba9c:procfs/vendor/github.com/prometheus/procfs \
|
||||||
|
beorn7:perks:4c0e845:perks/vendor/github.com/beorn7/perks \
|
||||||
|
golang:protobuf:2bba060:protobuf/vendor/github.com/golang/protobuf \
|
||||||
|
matttproud:golang_protobuf_extensions:c12348c:extensions/vendor/github.com/matttproud/golang_protobuf_extensions \
|
||||||
|
sirupsen:logrus:91da99d:logrus/vendor/github.com/Sirupsen/logrus \
|
||||||
|
golang:crypto:3d3f9f41:crypto/vendor/golang.org/x/crypto \
|
||||||
|
golang:sys:33540a1f6037:sys/vendor/golang.org/x/sys
|
||||||
|
|
||||||
|
GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT}
|
||||||
|
|
||||||
|
USE_RC_SUBR= unbound_exporter
|
||||||
|
|
||||||
|
pre-test:
|
||||||
|
${SETENV} GOPATH="${WRKDIR}"
|
||||||
|
|
||||||
|
.include <bsd.port.mk>
|
23
distinfo
Normal file
23
distinfo
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
TIMESTAMP = 1601112075
|
||||||
|
SHA256 (kumina-unbound_exporter-v0.3_GH0.tar.gz) = 6fee9aa7c0d1f6310832dcd2d41240f0c198e67a863f1b239c286cc1fd523d0e
|
||||||
|
SIZE (kumina-unbound_exporter-v0.3_GH0.tar.gz) = 12018
|
||||||
|
SHA256 (prometheus-client_golang-3fb53d_GH0.tar.gz) = 778ce90fdb4610cfc7c6382db9455ba15ca63c48c3f0e21cff9f1d0efeef98d3
|
||||||
|
SIZE (prometheus-client_golang-3fb53d_GH0.tar.gz) = 129739
|
||||||
|
SHA256 (prometheus-client_model-6f38060_GH0.tar.gz) = 6b4cc049a4588d8e93b7acf6cffa6a53034d5410128ae3752263f2bacf9e606c
|
||||||
|
SIZE (prometheus-client_model-6f38060_GH0.tar.gz) = 54645
|
||||||
|
SHA256 (prometheus-common-49fee29_GH0.tar.gz) = c38dd9ce34f65921f8e7604e6be471f4a49626b63e7312db21f98d65085a7be6
|
||||||
|
SIZE (prometheus-common-49fee29_GH0.tar.gz) = 59151
|
||||||
|
SHA256 (prometheus-procfs-a1dba9c_GH0.tar.gz) = 1702ef1142513b687bd544962828432f88195e12bbb079cbd68670b00c3e2d18
|
||||||
|
SIZE (prometheus-procfs-a1dba9c_GH0.tar.gz) = 31615
|
||||||
|
SHA256 (beorn7-perks-4c0e845_GH0.tar.gz) = 2d0c7784d2695b09c87710bc8c3c3d5b88ffeece31a650ed901763d215615478
|
||||||
|
SIZE (beorn7-perks-4c0e845_GH0.tar.gz) = 10593
|
||||||
|
SHA256 (golang-protobuf-2bba060_GH0.tar.gz) = ae917f15fd7de724cdce087b451326e6f364a898f03dc453a912ed7918e87742
|
||||||
|
SIZE (golang-protobuf-2bba060_GH0.tar.gz) = 245284
|
||||||
|
SHA256 (matttproud-golang_protobuf_extensions-c12348c_GH0.tar.gz) = da165c9275b77a0994b815bc7d761dcb2e4799a90fe49eec08d8bdff3a683f48
|
||||||
|
SIZE (matttproud-golang_protobuf_extensions-c12348c_GH0.tar.gz) = 37200
|
||||||
|
SHA256 (sirupsen-logrus-91da99d_GH0.tar.gz) = fe1633e0563ba4f1c24ad0a056ba71a0e19731052085470638ca0f6b084f6f1a
|
||||||
|
SIZE (sirupsen-logrus-91da99d_GH0.tar.gz) = 37938
|
||||||
|
SHA256 (golang-crypto-3d3f9f41_GH0.tar.gz) = 4f7727c350599f8254ebbf9bc98ff5a195628e68cb76df4eb7043d2fd9f431c6
|
||||||
|
SIZE (golang-crypto-3d3f9f41_GH0.tar.gz) = 1644603
|
||||||
|
SHA256 (golang-sys-33540a1f6037_GH0.tar.gz) = 09ebdf007413c2eaddce123137443d08d1848be410c58896e772f0481ec385d5
|
||||||
|
SIZE (golang-sys-33540a1f6037_GH0.tar.gz) = 1497659
|
77
files/unbound_exporter.in
Normal file
77
files/unbound_exporter.in
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# $FreeBSD: head/net-mgmt/unbound_exporter/files/unbound_exporter.in 446121 2017-07-17 22:26:33Z bsam $
|
||||||
|
|
||||||
|
# PROVIDE: unbound_exporter
|
||||||
|
# REQUIRE: LOGIN
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
#
|
||||||
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
||||||
|
# to enable this service:
|
||||||
|
#
|
||||||
|
# unbound_exporter_enable (bool): Set to NO by default
|
||||||
|
# Set it to YES to enable unbound_exporter
|
||||||
|
# unbound_exporter_user (string): Set user to run unbound_exporter
|
||||||
|
# Default is "%%USERS%%"
|
||||||
|
# unbound_exporter_group (string): Set group to run unbound_exporter
|
||||||
|
# Default is "%%GROUPS%%"
|
||||||
|
# unbound_exporter_log_file (string): Set file that unbound_exporter will log to
|
||||||
|
# Default is "/var/log/unbound_exporter.log"
|
||||||
|
# unbound_exporter_host (string): Set unbound socket path
|
||||||
|
# Default is /var/run/local_unbound.ctl
|
||||||
|
# unbound_exporter_ca (string): Set unbound ca filename
|
||||||
|
# Default is "" (use socket)
|
||||||
|
# unbound_exporter_cert (string): Set unbound control cert filename
|
||||||
|
# Default is "" (use socket)
|
||||||
|
# unbound_exporter_key (string): Set unbound control key filename
|
||||||
|
# Default is "" (use socket)
|
||||||
|
# unbound_exporter_bind (string): Set address to listen on
|
||||||
|
# Default is :9167
|
||||||
|
# unbound_exporter_args (string): Set additional command line arguments
|
||||||
|
# Default is ""
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name=unbound_exporter
|
||||||
|
rcvar=unbound_exporter_enable
|
||||||
|
|
||||||
|
load_rc_config $name
|
||||||
|
|
||||||
|
: ${unbound_exporter_enable:=NO}
|
||||||
|
: ${unbound_exporter_user:=unbound}
|
||||||
|
: ${unbound_exporter_group:=unbound}
|
||||||
|
: ${unbound_exporter_log_file=/var/log/unbound_exporter.log}
|
||||||
|
: ${unbound_exporter_host=/var/run/local_unbound.ctl}
|
||||||
|
: ${unbound_exporter_bind=:9167}
|
||||||
|
|
||||||
|
pidfile=/var/run/unbound_exporter.pid
|
||||||
|
command=/usr/sbin/daemon
|
||||||
|
procname="%%PREFIX%%/bin/unbound_exporter"
|
||||||
|
|
||||||
|
if [ -n "${unbound_exporter_cert}" ]; then
|
||||||
|
command_args="-p ${pidfile} /usr/bin/env ${procname} \
|
||||||
|
-unbound.ca ${unbound_exporter_ca} \
|
||||||
|
-unbound.cert ${unbound_exporter_cert} \
|
||||||
|
-unbound.key ${unbound_exporter_key} \
|
||||||
|
-web.listen-address ${unbound_exporter_bind} \
|
||||||
|
${unbound_exporter_args} > ${unbound_exporter_log_file} 2>&1"
|
||||||
|
else
|
||||||
|
command_args="-p ${pidfile} /usr/bin/env ${procname} \
|
||||||
|
-unbound.host ${unbound_exporter_host} \
|
||||||
|
-web.listen-address ${unbound_exporter_bind} \
|
||||||
|
${unbound_exporter_args} > ${unbound_exporter_log_file} 2>&1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
start_precmd=unbound_exporter_startprecmd
|
||||||
|
|
||||||
|
unbound_exporter_startprecmd()
|
||||||
|
{
|
||||||
|
if [ ! -e ${pidfile} ]; then
|
||||||
|
install -o ${unbound_exporter_user} -g ${unbound_exporter_group} /dev/null ${pidfile};
|
||||||
|
fi
|
||||||
|
if [ ! -f "${unbound_exporter_log_file}" ]; then
|
||||||
|
install -o ${unbound_exporter_user} -g ${unbound_exporter_group} -m 640 /dev/null ${unbound_exporter_log_file};
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
6
pkg-descr
Normal file
6
pkg-descr
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Unbound_exporter connects to Unbounds TLS control socket and sends the
|
||||||
|
stats_noreset command, causing Unbound to return metrics as key-value
|
||||||
|
pairs. The metrics exporter converts Unbound metric names to Prometheus
|
||||||
|
metric names and labels by using a set of regular expressions.
|
||||||
|
|
||||||
|
WWW: https://github.com/kumina/unbound_exporter
|
Loading…
Reference in New Issue
Block a user