I opted in to provide data to flightradar24 which has several benefits, the best of which is that I get a Business subscription for free. The stuff runs on a software-defined radio receiver connected to a Raspberry Pi.
Unfortunately — unknown to me as to why — the software can become flaky and disconnect without notifying me. So I made it my mission to have some sort of monitoring.
There’s a command — fr24feed-status — that reports on what’s going on. An example output looks like this:
Whenever any of the responses contains “Failed” something went awry, that’s when I wanted a notification. Problem #1, I don’t speak bash. Enter ChatGPT, and the question: write a bash script that runs fr24feed-status and if the result contains Failed then email X.
It’s actually not that hard, could have learned myself…
The most complex bit was to make sure that the Raspberry can send actual emails. Mailx is your friend. You need an application password and a configuration file to succeed.
So far it’s been stable so needs testing. 😅