Lines 19-24
Link Here
|
19 |
# Default is ":9115". |
19 |
# Default is ":9115". |
20 |
# blackbox_exporter_config (string): Set configuration file of blackbox_exporter |
20 |
# blackbox_exporter_config (string): Set configuration file of blackbox_exporter |
21 |
# Default is "%%PREFIX%%/etc/blackbox_exporter.yml". |
21 |
# Default is "%%PREFIX%%/etc/blackbox_exporter.yml". |
|
|
22 |
# blackbox_exporter_log_file (string): Set log file of blackbox_exporter |
23 |
# Default is "/var/log/blackbox_exporter.log". |
22 |
|
24 |
|
23 |
. /etc/rc.subr |
25 |
. /etc/rc.subr |
24 |
|
26 |
|
Lines 33-38
load_rc_config $name
Link Here
|
33 |
: ${blackbox_exporter_args:=""} |
35 |
: ${blackbox_exporter_args:=""} |
34 |
: ${blackbox_exporter_listen_address:=":9115"} |
36 |
: ${blackbox_exporter_listen_address:=":9115"} |
35 |
: ${blackbox_exporter_config:="%%PREFIX%%/etc/blackbox_exporter.yml"} |
37 |
: ${blackbox_exporter_config:="%%PREFIX%%/etc/blackbox_exporter.yml"} |
|
|
38 |
: ${blackbox_exporter_log_file:="/var/log/blackbox_exporter.log"} |
36 |
|
39 |
|
37 |
pidfile=/var/run/blackbox_exporter.pid |
40 |
pidfile=/var/run/blackbox_exporter.pid |
38 |
command="/usr/sbin/daemon" |
41 |
command="/usr/sbin/daemon" |
Lines 40-53
procname="%%PREFIX%%/bin/blackbox_exporter"
Link Here
|
40 |
command_args="-p ${pidfile} /usr/bin/env ${procname} \ |
43 |
command_args="-p ${pidfile} /usr/bin/env ${procname} \ |
41 |
--web.listen-address=${blackbox_exporter_listen_address} \ |
44 |
--web.listen-address=${blackbox_exporter_listen_address} \ |
42 |
--config.file=${blackbox_exporter_config} \ |
45 |
--config.file=${blackbox_exporter_config} \ |
43 |
${blackbox_exporter_args}" |
46 |
${blackbox_exporter_args} >> ${blackbox_exporter_log_file} 2>&1" |
44 |
|
47 |
|
45 |
start_precmd=blackbox_exporter_startprecmd |
48 |
start_precmd=blackbox_exporter_startprecmd |
46 |
|
49 |
|
47 |
blackbox_exporter_startprecmd() |
50 |
blackbox_exporter_startprecmd() |
48 |
{ |
51 |
{ |
49 |
if [ ! -e ${pidfile} ]; then |
52 |
if [ ! -e ${pidfile} ]; then |
50 |
install -o ${blackbox_exporter_user} -g ${blackbox_exporter_group} /dev/null ${pidfile}; |
53 |
install \ |
|
|
54 |
-o ${blackbox_exporter_user} \ |
55 |
-g ${blackbox_exporter_group} \ |
56 |
/dev/null ${pidfile}; |
57 |
fi |
58 |
if [ ! -e ${blackbox_exporter_log_file} ]; then |
59 |
install \ |
60 |
-o ${blackbox_exporter_user} \ |
61 |
-g ${blackbox_exporter_group} \ |
62 |
-m 640 \ |
63 |
/dev/null ${blackbox_exporter_log_file}; |
51 |
fi |
64 |
fi |
52 |
} |
65 |
} |
53 |
|
66 |
|