Date: Tue, 15 Jun 2021 01:22:39 GMT From: Guangyuan Yang <ygy@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 616f6f41d370 - main - net-mgmt/bind_exporter: New port Message-ID: <202106150122.15F1Mdxs075475@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by ygy: URL: https://cgit.FreeBSD.org/ports/commit/?id=616f6f41d370868ea4fb49e026cad28eeb9e6c86 commit 616f6f41d370868ea4fb49e026cad28eeb9e6c86 Author: Matt Moriarity <matt@mattmoriarity.com> AuthorDate: 2021-06-15 01:22:16 +0000 Commit: Guangyuan Yang <ygy@FreeBSD.org> CommitDate: 2021-06-15 01:22:16 +0000 net-mgmt/bind_exporter: New port Prometheus exporter for BIND server statistics. PR: 255449 Approved by: lwhsu (mentor) --- net-mgmt/Makefile | 1 + net-mgmt/bind_exporter/Makefile | 55 +++++++++++++++++++++++ net-mgmt/bind_exporter/distinfo | 49 ++++++++++++++++++++ net-mgmt/bind_exporter/files/bind_exporter.in | 65 +++++++++++++++++++++++++++ net-mgmt/bind_exporter/pkg-descr | 4 ++ net-mgmt/bind_exporter/pkg-plist | 1 + 6 files changed, 175 insertions(+) diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 10c25e47915e..b0465722bbcf 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -17,6 +17,7 @@ SUBDIR += bgpq3 SUBDIR += bgpq4 SUBDIR += bgpuma + SUBDIR += bind_exporter SUBDIR += blackbox_exporter SUBDIR += bosun SUBDIR += bpft diff --git a/net-mgmt/bind_exporter/Makefile b/net-mgmt/bind_exporter/Makefile new file mode 100644 index 000000000000..7cc44d2cc90a --- /dev/null +++ b/net-mgmt/bind_exporter/Makefile @@ -0,0 +1,55 @@ +# Created by: Matt Moriarity <matt@mattmoriarity.com> + +PORTNAME= bind_exporter +PORTVERSION= 0.4.0 +DISTVERSIONPREFIX=v +CATEGORIES= net-mgmt dns + +MAINTAINER= matt@mattmoriarity.com +COMMENT= Prometheus exporter for BIND server statistics + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go:modules +USE_GITHUB= yes +GH_ACCOUNT= prometheus-community +USE_RC_SUBR= bind_exporter + +GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} +GO_BUILDFLAGS= -v -ldflags "${LD_FLAG_STRING}" + +BUILD_USER?= ${USER} +LD_FLAG_STRING= -s \ + ${LD_FLAG_X_PREFIX}.Version=${PORTVERSION} \ + ${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ + ${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ + ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} +LD_FLAG_X_PREFIX= -X github.com/prometheus/common/version + +GH_TUPLE= \ + alecthomas:kingpin:v2.2.6:alecthomas_kingpin/vendor/gopkg.in/alecthomas/kingpin.v2 \ + alecthomas:template:fb15b899a751:alecthomas_template/vendor/github.com/alecthomas/template \ + alecthomas:units:f65c72e2690d:alecthomas_units/vendor/github.com/alecthomas/units \ + beorn7:perks:v1.0.1:beorn7_perks/vendor/github.com/beorn7/perks \ + cespare:xxhash:v2.1.1:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \ + go-kit:kit:v0.10.0:go_kit_kit/vendor/github.com/go-kit/kit \ + go-logfmt:logfmt:v0.5.0:go_logfmt_logfmt/vendor/github.com/go-logfmt/logfmt \ + go-yaml:yaml:v2.4.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \ + golang:crypto:5f87f3452ae9:golang_crypto/vendor/golang.org/x/crypto \ + golang:net:4c5254603344:golang_net/vendor/golang.org/x/net \ + golang:protobuf:v1.4.3:golang_protobuf/vendor/github.com/golang/protobuf \ + golang:sys:f9fddec55a1e:golang_sys/vendor/golang.org/x/sys \ + golang:text:v0.3.2:golang_text/vendor/golang.org/x/text \ + jpillora:backoff:v1.0.0:jpillora_backoff/vendor/github.com/jpillora/backoff \ + matttproud:golang_protobuf_extensions:v1.0.1:matttproud_golang_protobuf_extensions/vendor/github.com/matttproud/golang_protobuf_extensions \ + mwitkow:go-conntrack:2f068394615f:mwitkow_go_conntrack/vendor/github.com/mwitkow/go-conntrack \ + pkg:errors:v0.9.1:pkg_errors/vendor/github.com/pkg/errors \ + prometheus:client_golang:v1.9.0:prometheus_client_golang/vendor/github.com/prometheus/client_golang \ + prometheus:client_model:v0.2.0:prometheus_client_model/vendor/github.com/prometheus/client_model \ + prometheus:common:v0.15.0:prometheus_common/vendor/github.com/prometheus/common \ + prometheus:exporter-toolkit:v0.5.0:prometheus_exporter_toolkit/vendor/github.com/prometheus/exporter-toolkit \ + prometheus:procfs:v0.2.0:prometheus_procfs/vendor/github.com/prometheus/procfs \ + protocolbuffers:protobuf-go:v1.23.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf + +.include <bsd.port.mk> diff --git a/net-mgmt/bind_exporter/distinfo b/net-mgmt/bind_exporter/distinfo new file mode 100644 index 000000000000..557e3619c37a --- /dev/null +++ b/net-mgmt/bind_exporter/distinfo @@ -0,0 +1,49 @@ +TIMESTAMP = 1619572982 +SHA256 (prometheus-community-bind_exporter-v0.4.0_GH0.tar.gz) = d3ae7524cf16b94e47e17c19d943cc59a1679f2846fe685e4448abed62d8ad4f +SIZE (prometheus-community-bind_exporter-v0.4.0_GH0.tar.gz) = 59975 +SHA256 (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 4624eae43489de8a71ea60efaf6744c581b6bd62909f7514c484c1ea0efaba5a +SIZE (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 44383 +SHA256 (alecthomas-template-fb15b899a751_GH0.tar.gz) = 2e2a44375eca48ce941182504b5d13aa98182b9a3f64ace33bfda52208bd0f5e +SIZE (alecthomas-template-fb15b899a751_GH0.tar.gz) = 55339 +SHA256 (alecthomas-units-f65c72e2690d_GH0.tar.gz) = ece06024b01821e013bd7158dfe8ec8cc697f586ce8d3cfaa22edde8c2f022c3 +SIZE (alecthomas-units-f65c72e2690d_GH0.tar.gz) = 4925 +SHA256 (beorn7-perks-v1.0.1_GH0.tar.gz) = 98db84bb0224a26094e6adba91b7ee7a1a7ace28cb648d818f8e779e6a19f825 +SIZE (beorn7-perks-v1.0.1_GH0.tar.gz) = 10867 +SHA256 (cespare-xxhash-v2.1.1_GH0.tar.gz) = 0ee31178d2c5a1249be4e26294a2f428008dc4e1ecbbfbe47f74e41026df1148 +SIZE (cespare-xxhash-v2.1.1_GH0.tar.gz) = 9292 +SHA256 (go-kit-kit-v0.10.0_GH0.tar.gz) = c0fac2e37b981e4c18e4f210b92e1393bd59dadd7c7fc043ec46d1c9834eba85 +SIZE (go-kit-kit-v0.10.0_GH0.tar.gz) = 274801 +SHA256 (go-logfmt-logfmt-v0.5.0_GH0.tar.gz) = 76727000951c187d058289d8e83d3e2ad480a5d44c7c83b025b78b7eb6bf0258 +SIZE (go-logfmt-logfmt-v0.5.0_GH0.tar.gz) = 11745 +SHA256 (go-yaml-yaml-v2.4.0_GH0.tar.gz) = d8e94679e5fff6bd1a35e10241543929a5f3da44f701755babf99b3daf0faac0 +SIZE (go-yaml-yaml-v2.4.0_GH0.tar.gz) = 73209 +SHA256 (golang-crypto-5f87f3452ae9_GH0.tar.gz) = 8e905a4ce396416a8c8afd8075b93da404f77a9ec1475ad2814d289a1e21a0ee +SIZE (golang-crypto-5f87f3452ae9_GH0.tar.gz) = 1721681 +SHA256 (golang-net-4c5254603344_GH0.tar.gz) = 5957e628f2676d9e6c9517890bdcec334e8cac53d0f000b42ed6364a0550e152 +SIZE (golang-net-4c5254603344_GH0.tar.gz) = 1177478 +SHA256 (golang-protobuf-v1.4.3_GH0.tar.gz) = 5736f943f8647362f5559689df6154f3c85d261fb088867c8a68494e2a767610 +SIZE (golang-protobuf-v1.4.3_GH0.tar.gz) = 171969 +SHA256 (golang-sys-f9fddec55a1e_GH0.tar.gz) = 1ab3f80841babed9c5cd8e93f69bfcb7847c406e767b5d86d5da7dc3c0f24931 +SIZE (golang-sys-f9fddec55a1e_GH0.tar.gz) = 1090464 +SHA256 (golang-text-v0.3.2_GH0.tar.gz) = 0b9309698f5708531c5377ab1e29b423a6d9e20c55a8d386c3b8283428212f22 +SIZE (golang-text-v0.3.2_GH0.tar.gz) = 7168069 +SHA256 (jpillora-backoff-v1.0.0_GH0.tar.gz) = 611b29ce95acfa2997e3449762a3df68fcaa773db045535f26eb5c686106351f +SIZE (jpillora-backoff-v1.0.0_GH0.tar.gz) = 3507 +SHA256 (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b +SIZE (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 37184 +SHA256 (mwitkow-go-conntrack-2f068394615f_GH0.tar.gz) = 5bb72eaf9a4ffd7d0353fa6944951d244df89d879ac36d4b9860fd159162dd81 +SIZE (mwitkow-go-conntrack-2f068394615f_GH0.tar.gz) = 17140 +SHA256 (pkg-errors-v0.9.1_GH0.tar.gz) = 56bfd893023daa498508bfe161de1be83299fcf15376035e7df79cbd7d6fa608 +SIZE (pkg-errors-v0.9.1_GH0.tar.gz) = 13415 +SHA256 (prometheus-client_golang-v1.9.0_GH0.tar.gz) = 92ccfb35268ce2de6beeb45d4b5639e4bce78111b8629bcde5727165f7e1afb1 +SIZE (prometheus-client_golang-v1.9.0_GH0.tar.gz) = 177330 +SHA256 (prometheus-client_model-v0.2.0_GH0.tar.gz) = 4ab1be9cdfa702d7f49beeb09a256bcc6a2aad55e8a0a37e7732a46934264e12 +SIZE (prometheus-client_model-v0.2.0_GH0.tar.gz) = 10986 +SHA256 (prometheus-common-v0.15.0_GH0.tar.gz) = f0957de56c09431076239d27bb85e07841bb832d0c99210087bc6da63a0b2cb6 +SIZE (prometheus-common-v0.15.0_GH0.tar.gz) = 124369 +SHA256 (prometheus-exporter-toolkit-v0.5.0_GH0.tar.gz) = 60472227a183070c7eb008c181fe434bf4986f406c3d1500cdafd118362a49fe +SIZE (prometheus-exporter-toolkit-v0.5.0_GH0.tar.gz) = 47832 +SHA256 (prometheus-procfs-v0.2.0_GH0.tar.gz) = b6c013031ac8b9f8f9e1595103c48feb80dfe59c37aac73efe724fddbc0b3f50 +SIZE (prometheus-procfs-v0.2.0_GH0.tar.gz) = 157368 +SHA256 (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = e7266bedaa4f110216fce52ae533dc5eba475d3829bb0592e8876684e202ae1f +SIZE (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = 1214648 diff --git a/net-mgmt/bind_exporter/files/bind_exporter.in b/net-mgmt/bind_exporter/files/bind_exporter.in new file mode 100644 index 000000000000..44d9f7be6317 --- /dev/null +++ b/net-mgmt/bind_exporter/files/bind_exporter.in @@ -0,0 +1,65 @@ +#!/bin/sh + +# PROVIDE: bind_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# bind_exporter_enable (bool): Set to NO by default. +# Set it to YES to enable bind_exporter. +# bind_exporter_user (string): Set user that bind_exporter will run under +# Default is "nobody". +# bind_exporter_group (string): Set group that bind_exporter will run under +# Default is "nobody". +# bind_exporter_args (string): Set extra arguments to pass to bind_exporter +# Default is "". +# bind_exporter_listen_address (string):Set ip:port that bind_exporter will listen on +# Default is ":9119". +# bind_exporter_stats_url (string): Set URL where BIND is serving statistics +# Default is "http://localhost:8053/". +# bind_exporter_named_pidfile (path): Set path to named's pidfile +# Default is "/var/run/named/pid". + +. /etc/rc.subr + +name=bind_exporter +desc="Prometheus exporter for BIND" +rcvar=bind_exporter_enable + +load_rc_config $name + +: ${bind_exporter_enable:="NO"} +: ${bind_exporter_user:="nobody"} +: ${bind_exporter_group:="nobody"} +: ${bind_exporter_args:=""} +: ${bind_exporter_listen_address:=":9119"} +: ${bind_exporter_stats_url:="http://localhost:8053/"} +: ${bind_exporter_named_pidfile:="/var/run/named/pid"} + + +pidfile=/var/run/bind_exporter.pid +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/bind_exporter" +command_args="-f -p ${pidfile} -T ${name} \ + /usr/bin/env ${procname} \ + --web.listen-address=${bind_exporter_listen_address} \ + --bind.pid-file=${bind_exporter_named_pidfile} \ + --bind.stats-url=${bind_exporter_stats_url} \ + ${bind_exporter_args}" + +start_precmd=bind_exporter_startprecmd + +bind_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install \ + -o ${bind_exporter_user} \ + -g ${bind_exporter_group} \ + /dev/null ${pidfile}; + fi +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net-mgmt/bind_exporter/pkg-descr b/net-mgmt/bind_exporter/pkg-descr new file mode 100644 index 000000000000..9664ff4da396 --- /dev/null +++ b/net-mgmt/bind_exporter/pkg-descr @@ -0,0 +1,4 @@ +BIND exporter is a Prometheus exporter for statistics from a BIND DNS server. +It uses the statistics channel support in BIND to collect the statistics. + +WWW: https://github.com/prometheus-community/bind_exporter diff --git a/net-mgmt/bind_exporter/pkg-plist b/net-mgmt/bind_exporter/pkg-plist new file mode 100644 index 000000000000..75a99319b50b --- /dev/null +++ b/net-mgmt/bind_exporter/pkg-plist @@ -0,0 +1 @@ +bin/bind_exporter
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106150122.15F1Mdxs075475>