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
 

I have been having quite a lot of trouble with my T-Mobile business internet. I would like to set up a pi so that when it loses internet it sends an email, and another when internet is restored (I realize without net the outage email will not actually send, but if there is a time stamp I can at least present it to T-Mobile and say look this is a serious issue when my net is down more than it is up), and run an hourly speed test and email the results. For a novice is something like this feasible?

you are viewing a single comment's thread
view the rest of the comments
[–] wizzor@sopuli.xyz 3 points 2 years ago

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.