Today I got home and my Raspberry Pi OH system was non responsive and as far as I can tell it’s been like that for a couple of hours. I’m unable to ping or SSH to it at all.
Does anyone have any ideas how I can monitor my Raspberry Pi and get an email notification when it’s unreachable? Could I get the OpenHAB Cloud to notify me?
You could do that with an ESP8266 that receives a message from OH. Then a watchdog would send a mail in case oh stops.
I don’t think that you can do that from myopenHAB
As the pure knowledge that your server has become unresponsive won’t really get you anywhere, I’d suggest to run another Pi with a watchdog process. You might even connect it to a relay and run your OH Pi’s power through that so you can automatically powercycle in such a case. Won’t fix all potential problems but might help in a number of lockup situations.
I’m sure the OpenHAB android app used to send you a notification when your system went offline… Is this no longer the case?
My system has been solid for a few months so not sure what the issue could be…
Thanks for the suggestions guys, I will investigate further.
It is supposed to. During troubles awhile back that was turned off for some reason and not turned on. Go to this issue and give it a bump. https://github.com/openhab/openhab-cloud/issues/212
As for a watchdog, indeed, you will need something separate from OH or from the RPi for the most part. You might be able to get away with setting up a watchdog on the RPi itself that reboots the RPi if it loses network or the like, but if the RPi died because of a kernel panic or the like it will be dead as a door nail. There are a few options on Linux for setting up a watchdog like this. A Google search should give you plenty of tutorials.
I have something similar set up to what Markus describes for my RPis around the house. If I ever get a LWT from those machines OH will wait a bit, check to see if they have come back online and if not cycle the power to get them to come back. It’s not the safest way to handle that sort of problem but it was a compromise between letting the RPis remain offline until I could get home compared to the risk of an SD card corruption. But, I do not have anything similar set up for my OH server, unless you count what is built into ESXi.
It’s a hard problem to solve.