1
0
Fork 0
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:
kx1t 2023-03-28 16:01:27 -04:00
parent d3901f9904
commit 93d362bcc9
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bash
#shellcheck shell=bash
rm -f /run/readsb-prometheus.prom || true

View 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

View file

@ -314,6 +314,14 @@ if [[ -n "$READSB_BEAST_BAUDRATE" ]]; then
READSB_CMD+=("--beast-baudrate=$READSB_BEAST_BAUDRATE")
fi
#####################
# Handle --write-prom=<filepath>
if [[ -n "$PROMETHEUS_ENABLE" ]]; then
READSB_CMD+=("--write-prom=/run/readsb-prometheus.prom")
fi
# shellcheck disable=SC2086
if [[ -z "${LOGLEVEL}" ]] || [[ "${LOGLEVEL,,}" == "verbose" ]]; then
"${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS 2>&1 | \