net-mgmt/prometheus-bird-exporter: Prometheus metric exporter for the BIRD routing daemon.
Reviewed by: kevans Approved by: kevans (mentor) Pull Request: https://github.com/freebsd/freebsd-ports/pull/380
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
PORTNAME= prometheus-bird-exporter
|
||||
DISTVERSION= 1.4.3
|
||||
CATEGORIES= net-mgmt
|
||||
|
||||
MAINTAINER= ivy@FreeBSD.org
|
||||
COMMENT= Prometheus state exporter for BIRD routing daemon
|
||||
WWW= https://github.com/czerwonk/bird_exporter
|
||||
|
||||
LICENSE= MIT
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
USES= go:modules
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= czerwonk
|
||||
GH_PROJECT= bird_exporter
|
||||
|
||||
USE_RC_SUBR= bird_exporter
|
||||
|
||||
GO_MODULE= github.com/czerwonk/bird_exporter
|
||||
GO_MOD_DIST= https://raw.githubusercontent.com/czerwonk/bird_exporter/refs/tags/${DISTVERSION}/
|
||||
GO_TARGET= .:bird_exporter
|
||||
|
||||
PLIST_FILES= ${PREFIX}/bin/bird_exporter
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1,5 @@
|
||||
TIMESTAMP = 1740738528
|
||||
SHA256 (go/net-mgmt_prometheus-bird-exporter/czerwonk-bird_exporter-1.4.3_GH0/go.mod) = a1cb316ad9848531d1179c0f29927d738c21aa87f81505386326927319b1b391
|
||||
SIZE (go/net-mgmt_prometheus-bird-exporter/czerwonk-bird_exporter-1.4.3_GH0/go.mod) = 979
|
||||
SHA256 (go/net-mgmt_prometheus-bird-exporter/czerwonk-bird_exporter-1.4.3_GH0/czerwonk-bird_exporter-1.4.3_GH0.tar.gz) = 75bf25dc979f2bbc4dd95e31b25a9b2defd43d2ee5d9e790ef7e70c355443243
|
||||
SIZE (go/net-mgmt_prometheus-bird-exporter/czerwonk-bird_exporter-1.4.3_GH0/czerwonk-bird_exporter-1.4.3_GH0.tar.gz) = 109110
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
|
||||
# PROVIDE: bird_exporter
|
||||
# REQUIRE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
||||
# to enable this service:
|
||||
#
|
||||
# bird_exporter_enable (bool): Set to NO by default.
|
||||
# Set it to YES to enable bird_exporter.
|
||||
# bird_exporter_user (string): Set user that bird_exporter will run under
|
||||
# Default is "root".
|
||||
# bird_exporter_group (string): Set group that bird_exporter will run under
|
||||
# Default is "wheel".
|
||||
# bird_exporter_args (string): Set extra arguments to pass to bird_exporter
|
||||
# Default is "-bird.v2 -format.new".
|
||||
# bird_exporter_listen_address (string):Set ip:port that bird_exporter will listen on
|
||||
# Default is "localhost:9324".
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=bird_exporter
|
||||
rcvar=bird_exporter_enable
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${bird_exporter_enable:="NO"}
|
||||
: ${bird_exporter_user:="root"}
|
||||
: ${bird_exporter_group:="wheel"}
|
||||
: ${bird_exporter_args:="-bird.v2 -format.new"}
|
||||
: ${bird_exporter_listen_address:="localhost:9324"}
|
||||
: ${bird_exporter_socket:="/var/run/bird.ctl"}
|
||||
|
||||
pidfile=/var/run/bird_exporter.pid
|
||||
command="/usr/sbin/daemon"
|
||||
procname="%%PREFIX%%/bin/bird_exporter"
|
||||
command_args="-f -p ${pidfile} -t ${name} \
|
||||
/usr/bin/env ${procname} \
|
||||
-web.listen-address=${bird_exporter_listen_address} \
|
||||
${bird_exporter_args}"
|
||||
|
||||
start_precmd=bird_exporter_startprecmd
|
||||
|
||||
bird_exporter_startprecmd()
|
||||
{
|
||||
if [ ! -e ${pidfile} ]; then
|
||||
install \
|
||||
-o ${bird_exporter_user} \
|
||||
-g ${bird_exporter_group} \
|
||||
/dev/null ${pidfile};
|
||||
fi
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
@@ -0,0 +1,2 @@
|
||||
bird_exporter is a metric exporter for the BIRD routing daemon to use with
|
||||
Prometheus.
|
||||
Reference in New Issue
Block a user