Automatic reboot at zwave stick problem

I am running openhab on a virtual machine. Occasionally my z-wave stick gets disconnected from the virtual machine (once a month, I cannot pin-point the reason) and upon such event openHAB freezes.

So I decided to use monit to monitor if the openhab log file still grows. If it stops being updated, I monit sends an alert and a three minutes later reboots the virtual machine, which so far was the only cure for lost USB connection.

Monit config that does it:
check file openHAB.log with path /opt/openhab/logs/openhab.log if timestamp > 2 minutes then alert if timestamp > 5 minutes then exec "/usr/sbin/reboot"

Good idea, looks like monit is useful also for a lot of other things. Thanks for sharing.

For this single task it would be an overkill (even if it takes 3 minutes to install and setup), but yes, it is very useful to keep things up and running. You can easily monitor resources, services, processes, files etc and execute automated responses.

Yep, there’s nothing like JMX for getting some of the under-the-hood information on the OpenHAB JVM, but there’s nothing like Monit to kick it when it misbehaves!

Can you share the monit rule you use for this?