As my Intel n100 based home server crashes sometimes without reason (at least I did not find one) (every 2-3 weeks or so) I searched for a way to monitor the server without having to install a extra server. The physical n100 server runs Proxmox. On it runs Home Assistant OS and other stuff.
Of course it's not a good idea to monitor the physical server using a VM on it.....
So I had the idea... Why not use a Shelly Plug M Gen3 which I use to Power measure the server and as on/off switch for the server manually if it hangs (I also have a GL.iNet Comet for KVM)?
It can run scripts.. so why not use it as Server Monitor, signal fails via Telegram and maybe powercycle the server if it really hangs?
So, here it is:
Shelly Plug M Gen3 Server Monitor
Monitoring and auto-recovery script for the Shelly Plug M Gen3 (and other shellys...).
Features
- Monitoring of multiple devices
- HTTP-based availability checks
- Telegram notifications
- Power cycling in case of failure
- Watchdog
- Logging
- Protection against internet connection issues
- Recovery detection
Recommended Network Settings
- Static IP for the Shelly
- Good Wi-Fi signal
- 2.4 GHz Wi-Fi
- Stable power supply
Supported Devices
Well suited for:
- Home Assistant
- Unifi
- Web servers
- Cameras
Known Limitations
ICMP Ping
Shelly devices do not support ICMP functions such as ping.
Therefore, the script uses HTTP checks.
HTTPS without a valid certificate
HTTPS pages without a valid certificate (such as a default Proxmox installation) do not work.
Workaround: test an LXC running on the Proxmox server via HTTP, which therefore supports HTTP checks.
Main script
shellyServerMon.js
- Provides all the described functionality
- Set parameters in the script to your needs (see readme.md in the repo for detailed documentation)
- Run it on your Shelly Plug
- Mark it as "Run on startup"
Additional Scripts
shellyHostCheck.js
- Checks whether the selected host can be tested via HTTP
shellyTelegramTest.js
- Tests whether a message can be sent to the Telegram bot
haRESTsensor.yaml
- A REST sensor for Home Assistant
- Add it to the configuration.yaml
- Enter the IP address of the Shelly device running the script
- Restart Home Assistant
- The sensor provides the entity
sensor.servermonstatus - Can then be added to the dashboard for visual verification that the script is running. With a display condition it can be only displayed when status <> 'running'
- Status: 'running' or 'stopped'
- !! The Shelly must not be password protected, otherwise it will not work !!
haScriptRunCheckAutomation.yaml
- Sends the message 'serverMon is no longer running. Please check' to all HA client apps when the script stops
haTileServerMon.yaml
- A tile card for HA dashboards that is only displayed when the script is not running
Requirements
Hardware
- Shelly Plug M Gen3
- Wi-Fi connection
- Current firmware
Releases
- 2026/05/15 V0.4.0 Initial release - readme.md at the moment in german language only, but it's easy to understand