File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ exec /scripts/generate-prom.sh
Original file line number Diff line number Diff line change
1
+ longrun
Original file line number Diff line number Diff line change
1
+ #! /command/with-contenv bash
2
+ # shellcheck shell=bash
3
+
4
+ # generate prom file for consumption by for example docker-telegraf-adsb
5
+ # currently this only has autogain as the other metrics can be generated in docker-telegraf-adsb
6
+
7
+ OUT=/run/skyaware978/stats.prom
8
+ TMP=/run/skyaware978/stats.prom.tmp
9
+
10
+ function generate() {
11
+ if [[ -f " $AUTOGAIN_CURRENT_VALUE_FILE " ]]; then
12
+ echo " autogain_current_value=$( cat " $AUTOGAIN_CURRENT_VALUE_FILE " ) "
13
+ echo " autogain_max_value=$( cat " $AUTOGAIN_MAX_GAIN_VALUE_FILE " ) "
14
+ echo " autogain_min_value=$( cat " $AUTOGAIN_MIN_GAIN_VALUE_FILE " ) "
15
+ echo " autogain_pct_strong_messages_max=$AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX "
16
+ echo " autogain_pct_strong_messages_min=$AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN "
17
+ fi
18
+ }
19
+
20
+ while sleep 60; do
21
+ generate > " $TMP "
22
+ mv -f " $TMP " " $OUT "
23
+ done
24
+
25
+
You can’t perform that action at this time.
0 commit comments