Send warning on feed lost?

Is there a way to get an error message when a feed is getting to old, or if the “main thread” has crashed?
On my build (raspberry pi with the preconfigured sd image, connected to a diy CT sensor setup on arduino) sometimes stops feeding. The error message in the log is something like “main thread crashed”.(i cannot scroll back to find the error).
I would like to execute a script when this happens (to get a warning on my cell, of reboot the raspberry pi)

Yes, I had a similar issue here, I used NodeRED to act as a watchdog…