Package: prometheus-blackbox-exporter
Version: 0.23.0-4+b4
Severity: minor
X-Debbugs-Cc: [email protected]

Dear Maintainer,

I am using MX Linux 23.6, which is based on Debian 12.12.
I have installed the "prometheus-blackbox-exporter" and "prometheus" packages.

When I execute the following command, I get approximately the following error
message.

$ service prometheus-blackbox-exporter start
 failed!
Configuration test failed. Output of config test was:
Checking /etc/prometheus/blackbox.yml
  FAILED: parsing YAML file /etc/prometheus/blackbox.yml: yaml: unmarshal
errors:  line 49: field modules not found in type config.plain


As far as I understand the problem, it is not the configuration file
blackbox.yml, but rather the command that is supposed to check the
configuration file.

The “service” command accesses the file “/etc/init.d/prometheus-blackbox-
exporter”.
To start the service, the function do_start_prepare() is executed, which in
turn executes the function config_check(). In this function, the command
“promtool” is executed, which checks the configuration file
CFGFILE=/etc/prometheus/blackbox.yml.
The problem is that the promtool program, which is designed to check the
prometheus configuration, checks the configuration of the prometheus-blackbox-
exporter. But they are different programs with different configuration files.


My suggestion is to change the following line:
----------------------------------------------------
packet: prometheus-blackbox-exporter_0.23.0-4+b4_amd64.deb

Faulty line 35: errors="$(/usr/bin/promtool check config $CFGFILE 2>&1)" ||
retcode=$?
Corrected line: errors="$(/usr/bin/prometheus-blackbox-exporter --config.check
--config.file  $CFGFILE 2>&1)" || retcode=$?

It would be nice if the following text were also displayed in the event of an
error. (After Line 39: echo "$errors" >&2)
Use the command prometheus-blackbox-exporter --config.check to check the
configuration file.


Best regards
Matthias


-- System Information:
Debian Release: 12.12
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 
'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-40-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages prometheus-blackbox-exporter depends on:
ii  adduser                3.134
ii  debconf [debconf-2.0]  1.5.82
ii  init-system-helpers    1.65.2+deb12u1
ii  libc6                  2.36-9+deb12u13
ii  libcap2-bin            1:2.66-4+deb12u2

prometheus-blackbox-exporter recommends no packages.

prometheus-blackbox-exporter suggests no packages.

-- Configuration Files:
/etc/init.d/prometheus-blackbox-exporter changed:
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
DESC="Blackbox prober for Prometheus"
NAME=prometheus-blackbox-exporter
USER=prometheus
GROUP=$USER
DAEMON=/usr/bin/$NAME
PIDFILE=/run/prometheus/$NAME.pid
LOGFILE=/var/log/prometheus/$NAME.log
CFGFILE=/etc/prometheus/blackbox.yml
START_ARGS="--no-close --background --make-pidfile"
STOP_ARGS="--remove-pidfile"
config_check()
{
  retcode=0
  errors="$(/usr/bin/prometheus-blackbox-exporter --config.check --config.file  
$CFGFILE 2>&1)" || retcode=$?
  if [ $retcode -ne 0 ]; then
    log_failure_msg
    echo "Configuration test failed. Output of config test was:" >&2
    echo "$errors" >&2
    exit 2
  fi
}
do_start_prepare()
{
  config_check
  mkdir -p $(dirname $PIDFILE)
}
do_start_cmd_override()
{
  start-stop-daemon --start --quiet --oknodo \
    --exec $DAEMON --pidfile $PIDFILE --user $USER --group $GROUP \
    --chuid $USER:$GROUP $START_ARGS -- $ARGS >>$LOGFILE 2>&1
}
do_stop_cmd_override()
{
  start-stop-daemon --stop --quiet --oknodo --retry=TERM/30/KILL/5 \
    --exec $DAEMON --pidfile $PIDFILE --user $USER $STOP_ARGS
}
do_reload_prepare()
{
  config_check
}
alias do_reload=do_reload_sigusr1

/etc/prometheus/blackbox.yml changed:
modules:
  icmp:
    prober: icmp
  icmp_example:
    prober: icmp
    timeout: 5s
    icmp:
      preferred_ip_protocol: "ip4"
      source_ip_address: "127.0.0.1"


-- debconf information:
  prometheus-blackbox-exporter/want_cap_net_raw: false

Reply via email to