Is there a way to soft restart the hub using ssh?

Several times in the last month my hub has frozen. Is there a way I could:
a. Monitor that the hub is active
b. Use SSH to soft reset it automatically?

I have several Linux based devices I could run a cron job to do this.

I haven't added anything new to it for several months, so I am not sure if any of my devices or apps are the culprits.

Any ideas much appreciated!

There is no ssh access to the hub, at least not to us as users. But you don't need that to restart the hub if you want. An HTTP POST can do the trick: curl -X POST yourHubIP/hub/reboot (port 80 or 8080 if all is well; you'll need the latter if doing it from the hub itself; I guess port 8081 works as mentioned below? either assumes no login security, in which case you'd also need to send a cookie). "Monitoring" it to know if all is OK is a different issue. But in either case I'd ask: is there a particular issue you're trying to solve? A bad app or driver might be something I look for before I resort to this. Looking at your logs for errors might be a good place to start.

1 Like

a - yes. You can use curl or wget to see if the Hubitat process is "alive" at port 80.

b - not using ssh, but if the Hubitat process is not alive, you can use curl/wget to reboot the hub using port 8081. URLs to do so have been posted here previously.

1 Like

Thanks guys

Previously there hasn't been any clue in the log files. I use a Arduino to control relays for my heating system and this am while it was frozen we had no heat. I had to power cycle the Hubitat to get things working, I know that is bad but I had no choice

In your situation, I think it is definitely worth writing a shell script to periodically check if the Hubitat is up, and reboot it if it isn't. Just remember that if the main Hubitat process (port 80 and 8080) is not up and running, you will have to restart using port 8081.

Thanks,

I will see what I can do this weekend. Maybe even setup a push to my cellphone so I know when it happens. Another question. My Hub is a couple of years old, is it possible that is is nearing EOL?

No - I hope not!

1 Like