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,39 +1,39 @@ PORTNAME= blackbox_exporter DISTVERSIONPREFIX= v DISTVERSION= 0.24.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net-mgmt MAINTAINER= eduardo@FreeBSD.org COMMENT= Prometheus exporter for endpoints over HTTP(S), DNS, TCP and ICMP WWW= https://github.com/prometheus/blackbox_exporter LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= cpe go:modules CPE_VENDOR= prometheus USE_RC_SUBR= blackbox_exporter GO_MODULE= github.com/prometheus/blackbox_exporter SUB_FILES= pkg-message SUB_LIST= DISTVERSIONFULL=${DISTVERSIONFULL} USERS= prometheus GROUPS= prometheus PORTEXAMPLES= ${WRKSRC}/*.yml OPTIONS_DEFINE= EXAMPLES post-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/*.yml ${STAGEDIR}${EXAMPLESDIR} ${MKDIR} ${STAGEDIR}${DATADIR}/syslog.d \ ${STAGEDIR}${DATADIR}/newsyslog.conf.d ${INSTALL_DATA} ${PATCHDIR}/blackbox_exporter.syslog \ ${STAGEDIR}${DATADIR}/syslog.d/blackbox_exporter.conf ${INSTALL_DATA} ${PATCHDIR}/blackbox_exporter.newsyslog \ ${STAGEDIR}${DATADIR}/newsyslog.conf.d/blackbox_exporter.conf .include 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 @@ -1,60 +1,72 @@ #!/bin/sh # 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 (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 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="%%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} \ ${blackbox_exporter_args} 2>&1" start_precmd=blackbox_exporter_startprecmd blackbox_exporter_startprecmd() { if [ ! -e ${pidfile} ]; then install \ -o ${blackbox_exporter_user} \ -g ${blackbox_exporter_group} \ /dev/null ${pidfile}; else chown ${blackbox_exporter_user}:${blackbox_exporter_group} ${pidfile}; fi } run_rc_command "$1"