Electronics

PLEN

Network Watchdog: how do you know your home server is down?

A server can go down together with the system that was supposed to tell you about it. Strażnik sieci checks it from a separate ESP32 board and sends alerts to Telegram.

Karta monitorowanego celu z wykresem czasu odpowiedzi w panelu na telefonie

Szczegóły jednego celu na telefonie. Dane przykładowe.

Home Assistant won’t open. The films on the NAS won’t play either. The first question is usually: is it the server, the network, or just one application? Before we start fixing anything, we still need to work out what is actually broken.

That is what my “Strażnik sieci” (Polish for “network guard”) is for: a program running on a separate ESP32-S3 board that checks devices and services and reports failures on Telegram (project description in the repository). It is no substitute for a proper diagnosis, but it gives you somewhere to start instead of the mere fact that “something’s not working”.

Why a separate board and not yet another container in Proxmox?

If the monitoring runs on the same server as everything else, a server failure takes the notifications down with it; that is why Strażnik runs on a separate ESP32-S3 with its own power supply. This is the most important decision in the whole design, more important than how the panel looks or the charts.

To get started, all you need is an ESP32-S3-DevKitC-1 in the N16R8 version, a USB cable that carries data and a USB power supply; there is nothing to solder (parts list and assembly tips).

What it checks and when it decides something has failed

Strażnik checks whether a device answers a ping, whether a TCP port is reachable, whether an HTTP or HTTPS page responds, and whether DNS works (the types of tests described in the README). These are different questions: a computer that is up does not necessarily mean the service or application running on it is up too.

By default the checks run every 30 seconds, and an alert is raised after three failures in a row, so after about a minute and a half (default monitoring settings). A single lost reply should not immediately end in an alert message.

Take this example: the server answers a ping, but the Home Assistant panel won’t open. A separate test of the page lets you spot the problem with the service, instead of assuming the whole computer is fine just because it responds on the network. That distinction tells you more than a single green light next to an IP address.

One problem doesn’t have to mean ten alerts

Dependencies can be written into the configuration, so that a server failure produces one notification with the number of dependent targets, instead of a separate alert for every service (the dependency mechanism). If several applications run on one server, all of them being unreachable at once is not several independent failures.

This diagram shows nicely why it is worth entering dependencies at all. When the NAS disappears, starting the repair with Jellyfin would be a waste of time. First you need to check the device that service runs on.

A message on your phone, the details in the panel

A chat with the Strażnik sieci bot on Telegram: the reply to the /status command with a list of devices and their response times

Telegram handles the alerts, the messages saying something is back up, reminders about an ongoing failure and a daily “Strażnik is alive” message; the /status and /problemy commands let you check the situation without opening the panel (day-to-day use and bot commands). Day to day, there should be no need to keep an eye on yet another browser tab.

A button under the alert lets you mute the notifications without stopping the checks on the device (muting alerts). That comes in handy during an update, for instance: you already know why the service isn’t responding, so the next reminder adds nothing.

In the web panel you can look at a response-time chart, browse the log and add a new device with a form, on a phone as well (what the web panel can do). This is the place for a calmer look at the details when the message alone is no longer enough.

What happens when the internet goes down?

Without internet access Strażnik cannot send a Telegram message straight away: it puts it in a queue and sends it later with the time of the event, whereas if it loses its own Wi-Fi it does not run any checks (limitations and behaviour when connectivity is lost). A separate device solves the problem of depending on the server, but it does not give you an independent connection to the outside world.

Ethernet with PoE and backup text messages through a GSM module are only planned for now (project status). So in the current version don’t count on an instant alert over a second channel when your home connection stops working.

Optionally, states can be passed to Home Assistant over MQTT, but Strażnik does not need it to work (Home Assistant integration). It is an add-on to standalone monitoring, not a requirement for it.

When an alert alone isn’t enough: restarting the server over IPMI

Sometimes knowing about a failure is not enough, especially when there is nobody near the server. That is why Strażnik has optional power control over IPMI, that is, through a separate chip that manages the server, known as the BMC (description of the feature and setup instructions in the repository).

This feature requires a server with a BMC that supports IPMI 2.0 over the network; you cannot get it going on any old computer just by flashing the program (IPMI hardware requirements). Strażnik connects to the management controller rather than asking a hung operating system to carry out a command.

This is a hard reset, like pressing the RESET button on the case, not a graceful shutdown. It cuts applications off mid-work and can mean losing unsaved data. For that reason it is best treated as an emergency exit, not a routine way of fixing every failure.

First it checks whether the problem really looks like a hang

The procedure takes three things into account at once: the monitored server target has been unreachable for a set time – 5 minutes by default; its configured parent, e.g. a switch or router, is responding; and the BMC reports that the power is on (conditions for starting the rescue procedure). That is a suspected hang, and not a certain diagnosis, which is why the next step is a question to the user.

For the server target, the documentation recommends a port tied to the running system, e.g. SSH or the Proxmox panel, rather than a plain ping, and requires assigning a parent that represents the router or switch (configuring the server target). That way the check is a better answer to “is the system working?”, and not just “does the IP address respond?”.

On Telegram you decide what happens next

When it detects this situation, the bot sends a question with three buttons, and choosing a restart needs a separate confirmation on top (how the conversation with the bot goes). So you can react from your phone, but one accidental tap on the restart button does not restart the machine.

  • Restart: shows a second question asking you to confirm the hard reset.
  • Wait 30 min: postpones the decision; if the problem continues, Strażnik asks again, and the countdown of the optional automatic reset starts over.
  • Don’t restart: blocks any further automatic reaction for this failure; the manual restart command is still available.

If the BMC reports that the power is off, Strażnik offers a “Power on” button instead of a reset; when it cannot read the BMC state, it reports an error and does not perform an automatic reset blind (handling of power states and IPMI errors). After all, an unreachable server is not always a hung server.

What happens after the reset

After sending the reset, Strażnik waits for the monitored target to come back and notifies you when the server responds again; if it is not back within 15 minutes, it gives up on further automatic attempts and asks you to check the hardware (watching the server come back after a reset). The point is not to have a device pressing a virtual RESET button for ever.

The automatic reset is optional and off by default

You can switch on an automatic reset for when nobody answers the question; the default waiting time is 30 minutes from the notification, and the window in which it may act is 23:30–07:00 (automatic restart settings). This is a separate configuration decision, not the default behaviour once the board is plugged in.

The automatic reset requires the server’s parent to be up and the BMC to report that the power is on, it respects the time window and a gap of at least two hours between automatic resets; nor does it repeat a reset after an unsuccessful fifteen-minute wait for the server to come back (safeguards on the automatic reset). These limits apply to the automatic reaction; they are not a promise to block every manual command.

Outside the time window the automatic reset waits, and without a correctly set clock it does not trigger at all (the time-window check in the feature’s code). In particular, no reply on Telegram does not mean the restart will always happen exactly half an hour later.

First, a trial run without switching the server off

By default the feature runs in test mode: it reads the real power state from the BMC and goes through the notification procedure, but does not send the reset or power-on command (IPMI test mode). This is a good moment to check the configuration without interrupting your home services.

You can simulate a failure in the “Server” tab or with the /symuluj command, go through the confirmation on Telegram, and then end the trial with /symuluj stop; the simulation is available only in test mode, and after a simulated reset the target “comes back” after a minute (instructions for safe testing). Only after a trial like that is it worth deliberately switching the mode to the real one.

What you need to set up and how to control it by hand

In the settings you enter the BMC address, the credentials of a separate IPMI account with the OPERATOR privilege, the identifier of the monitored server, and the timings and operating mode; the connection requires IPMI 2.0 on UDP 623 with cipher suite 3 supported (configuring the account and the connection). There is no need to give Strażnik a BMC administrator account.

By hand, you can read the state with the /ipmi command, start a reset with confirmation through /restart, or use the “Server” tab, where the reset button has to be held down for two seconds (controlling the server manually). Before you enable real operations, make sure the chosen target and the BMC controller belong to the right server.

Where to start

The Strażnik sieci repository has the parts list, instructions for flashing the program, and the configuration of Wi-Fi, Telegram and the monitored devices. To begin with, it makes sense to add a few of the most important items, for example the router, the server and one service, and then check whether the expected alert arrives after you switch that service off on purpose.

Strażnik sieci: niezależny monitor sieci domowej na ESP32-S3 z alarmami na Telegram

  • C++
  • Last change 4 November 2026
View on GitHub

The point is not to have one more panel to stare at. The point is a simpler answer to the question that comes up with every failure: what has stopped working, and where do I start checking?

Related posts

Comments

No comments yet

Leave a comment

Your email address will not be published. Comments appear after approval.