Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log fixes #145

Merged
merged 5 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
2 changes: 0 additions & 2 deletions rootfs/etc/s6-overlay/s6-rc.d/piaware-log/run

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/etc/s6-overlay/s6-rc.d/piaware-log/type

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/piaware
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ fi

# shellcheck disable=SC2016
"${PIAWARE_BIN}" "${PIAWARE_CMD[@]}" \
2>&1 | stdbuf -o0 sed '/^$/d' | stdbuf -o0 awk '{print "[piaware] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
2>&1 | stdbuf -o0 sed '/^$/d' | stdbuf -o0 awk '{print "[piaware] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' | tee -a /var/log/piaware/current

sleep 5
7 changes: 0 additions & 7 deletions rootfs/etc/s6-overlay/scripts/piaware-log

This file was deleted.

2 changes: 1 addition & 1 deletion rootfs/scripts/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function check_logs_for_msgs_sent_to_fa () {
# $1 = sending process (eg: dump1090, socat, dump978-fa)
# $2 = number of output lines to consider (every line represents 5 minutes, so 12 would be an hour)
# ------
REGEX_FA_MSGS_SENT_PAST_5MIN="^(?'date'\d{4}-\d{1,2}-\d{1,2})\s+(?'time'\d{1,2}:\d{1,2}:[\d\.]+)\s+\[piaware\]\s+(?'date2'\d{4}\/\d{1,2}\/\d{1,2})\s+(?'time2'\d{1,2}:\d{1,2}:[\d\.]+)\s+\d+ msgs recv'd from $1 \(\K(?'msgslast5m'\d+) in last 5m\);\s+\d+ msgs sent to FlightAware\s*$"
REGEX_FA_MSGS_SENT_PAST_5MIN="^\[piaware\]\s+(?'date2'\d{4}\/\d{1,2}\/\d{1,2})\s+(?'time2'\d{1,2}:\d{1,2}:[\d\.]+)\s+\d+ msgs recv'd from $1 \(\K(?'msgslast5m'\d+) in last 5m\);\s+\d+ msgs sent to FlightAware\s*$"
NUM_MSGS_RECEIVED=$(tail -$(($2 * 10)) /var/log/piaware/current | grep -oP "$REGEX_FA_MSGS_SENT_PAST_5MIN" | tail "-$2" | tr -s " " | cut -d " " -f 1)
TOTAL_MSGS_RECEIVED=0
for NUM_MSGS in $NUM_MSGS_RECEIVED; do
Expand Down
Loading