mirror of
https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git
synced 2024-11-22 05:40:10 +00:00
add readsb-prometheus data
This commit is contained in:
parent
d3901f9904
commit
93d362bcc9
3 changed files with 24 additions and 0 deletions
4
rootfs/etc/cont-finish.d/02-remove-prometheus-data
Normal file
4
rootfs/etc/cont-finish.d/02-remove-prometheus-data
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
#shellcheck shell=bash
|
||||||
|
|
||||||
|
rm -f /run/readsb-prometheus.prom || true
|
12
rootfs/etc/services.d/prometheus-readsb/run
Normal file
12
rootfs/etc/services.d/prometheus-readsb/run
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
#shellcheck shell=bash
|
||||||
|
|
||||||
|
if [[ -n "$PROMETHEUS_ENABLE" ]]; then
|
||||||
|
while [[ ! -f /run/readsb-prometheus.prom ]]
|
||||||
|
do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo -e "HTTP/1.1 200 OK\nContent-Type: text/plain\n\n$(cat /run/readsb-prometheus.prom)" | ncat -l 9274 > /dev/null 2>&1
|
||||||
|
else
|
||||||
|
sleep infinity
|
||||||
|
fi
|
|
@ -314,6 +314,14 @@ if [[ -n "$READSB_BEAST_BAUDRATE" ]]; then
|
||||||
READSB_CMD+=("--beast-baudrate=$READSB_BEAST_BAUDRATE")
|
READSB_CMD+=("--beast-baudrate=$READSB_BEAST_BAUDRATE")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# Handle --write-prom=<filepath>
|
||||||
|
|
||||||
|
if [[ -n "$PROMETHEUS_ENABLE" ]]; then
|
||||||
|
READSB_CMD+=("--write-prom=/run/readsb-prometheus.prom")
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if [[ -z "${LOGLEVEL}" ]] || [[ "${LOGLEVEL,,}" == "verbose" ]]; then
|
if [[ -z "${LOGLEVEL}" ]] || [[ "${LOGLEVEL,,}" == "verbose" ]]; then
|
||||||
"${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS 2>&1 | \
|
"${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS 2>&1 | \
|
||||||
|
|
Loading…
Reference in a new issue