git: 8f0f02c25643 - main - net-mgmt/blackbox_exporter: Make syslog output configurable

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Mon, 12 Feb 2024 09:12:16 UTC
The branch main has been updated by eduardo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8f0f02c25643fcc0be1c488f4fa4f8e95a67716c

commit 8f0f02c25643fcc0be1c488f4fa4f8e95a67716c
Author:     Lexi Winter <lexi.freebsd@le-fay.org>
AuthorDate: 2024-02-12 09:10:01 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-02-12 09:12:03 +0000

    net-mgmt/blackbox_exporter: Make syslog output configurable
    
    Add the following new options, based on net-mgmt/ping_exporter:
    
    +# blackbox_exporter_syslog_output_tag (str):      Set syslog tag.
    +#               Default is "blackbox_exporter". See daemon(8).
    +# blackbox_exporter_syslog_output_priority (str): Set syslog priority.
    +#               Default is "notice". See daemon(8).
    +# blackbox_exporter_syslog_output_facility (str): Set syslog facility.
    +#               Default is "daemon". See daemon(8).
    
    the defaults are unchanged from before, i.e. it outputs at daemon.notice.
    
    PR:             276992
---
 net-mgmt/blackbox_exporter/Makefile                   |  2 +-
 net-mgmt/blackbox_exporter/files/blackbox_exporter.in | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/net-mgmt/blackbox_exporter/Makefile b/net-mgmt/blackbox_exporter/Makefile
index 8fdf03698d1a..7cabf70f70a6 100644
--- a/net-mgmt/blackbox_exporter/Makefile
+++ b/net-mgmt/blackbox_exporter/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	blackbox_exporter
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.24.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	net-mgmt
 
 MAINTAINER=	eduardo@FreeBSD.org
diff --git a/net-mgmt/blackbox_exporter/files/blackbox_exporter.in b/net-mgmt/blackbox_exporter/files/blackbox_exporter.in
index a00a9f0e5cc5..1ce33146773d 100644
--- a/net-mgmt/blackbox_exporter/files/blackbox_exporter.in
+++ b/net-mgmt/blackbox_exporter/files/blackbox_exporter.in
@@ -19,6 +19,12 @@
 #               Default is "localhost:9115".
 # blackbox_exporter_config (string):        Set configuration file of blackbox_exporter
 #               Default is "%%PREFIX%%/etc/blackbox_exporter.yml".
+# blackbox_exporter_syslog_output_tag (str):      Set syslog tag.
+#               Default is "blackbox_exporter". See daemon(8).
+# blackbox_exporter_syslog_output_priority (str): Set syslog priority.
+#               Default is "notice". See daemon(8).
+# blackbox_exporter_syslog_output_facility (str): Set syslog facility.
+#               Default is "daemon". See daemon(8).
 
 . /etc/rc.subr
 
@@ -33,11 +39,17 @@ load_rc_config $name
 : ${blackbox_exporter_group:=prometheus}
 : ${blackbox_exporter_listen_address=localhost:9115}
 : ${blackbox_exporter_config="%%PREFIX%%/etc/blackbox_exporter.yml"}
+: ${blackbox_exporter_syslog_output_tag=${name}}
+: ${blackbox_exporter_syslog_output_priority=notice}
+: ${blackbox_exporter_syslog_output_facility=daemon}
 
 pidfile=/var/run/blackbox_exporter.pid
 command=/usr/sbin/daemon
 procname="%%PREFIX%%/bin/blackbox_exporter"
-command_args="-p ${pidfile} -t ${name} -T ${name} -S \
+command_args="-p ${pidfile} -t ${name} -S \
+    -T ${blackbox_exporter_syslog_output_tag} \
+    -s ${blackbox_exporter_syslog_output_priority} \
+    -l ${blackbox_exporter_syslog_output_facility} \
     /usr/bin/env ${procname} \
     --web.listen-address=${blackbox_exporter_listen_address} \
     --config.file=${blackbox_exporter_config} \