this post was submitted on 27 Oct 2023
3 points (100.0% liked)
Single Board Computers
1413 readers
1 users here now
A community for the discussion of all single board computers. Raspberry Pi is ok, but there are so many other boards now that get looked over that deserve attention.
Post news, questions, your setups, guides, anything that has to do with SBCs. Server wide rules apply
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Perhaps it would be better to continously monitor the situation and send an email with start / stop time in one go.
Still, shouldn't be hard: Script that runs in a loop, that checks internet connectivity by connecting to a reliable source, eg. some major cloud provider's service If the service call times out, catch the error and record the time and enter a 2nd loop, which tries to send a message with the start time of the error and the time the loop ran.
Remember to put some sleep in the loops so that they run every few minutes or so.
I would also suggest something like a telegram or slack message. Modern email servers can be cantankerous about random scripts sending email.
You can build this with basically anything: Node red, python, ruby, shell scripts or home assistant would be my choices.
You might want to also set up some kind of monitoring in case the script goes down, many ways to do this, simplest one being a shell script which restarts a nested script or something like monit or systemd.