Konstantinos Antoniou.

← Projects

Monitoring and Alerting: Three Layers, So Silence Never Means Safe

I run monitoring on one principle: a quiet channel proves nothing. Any single alerting system can fail without telling anyone, so I run three independent ones, and before I trust silence I know what each of them would have said.

This page covers what each layer watches, how alerts reach me, the decisions I made and what they cost, and the places where my monitoring looked fine and was not.

The three layers

Zabbix: hosts, services and network gear

  • A native Zabbix 7.4 server with PostgreSQL, watching more than twenty hosts in ten host groups: Linux servers, Docker hosts, the Proxmox hypervisor, Vault, a Windows machine, and every router and access point over SNMP.
  • Agents run in active mode: they push to the server, so the server only needs its trapper and web ports open and nothing has to reach into the agents.
  • Four trigger actions, each scoped to one host group and each sending to its own Discord channel. Only severity Average or higher pages me. Warnings and information events never do.

Grafana Cloud: metrics, logs and dashboards

  • Grafana Alloy runs on every host and ships metrics and logs to Grafana Cloud’s free tier. The collectors are managed remotely through Fleet Management, which replaced a self-hosted Loki, Promtail and Uptime Kuma stack I used to run.
  • About 35 dashboards: mostly the pre-built integration dashboards for Linux, Windows, Docker, Vault and Raspberry Pi, plus ones I built myself for RabbitMQ traffic, n8n traffic, Nextcloud logs, and the traffic on this very site, built from its access logs.
  • About twenty fleet-wide alert rules: disk space (warning under 15% free, critical under 5%), memory (over 85% and over 95%), a host down for five minutes, CPU and load, network errors, containers down, plus RabbitMQ rules and Loki rules that read application logs.

Script-level alerts

Every maintenance script, whether a backup, certificate renewal, NAS or drive health check, or system update, publishes its result to RabbitMQ. A consumer formats it and delivers it to Discord, Telegram or Gmail. On Discord there is one channel per kind of alert: backups, certificates, Proxmox, Nextcloud, updates and so on. The broker design is written up in my Syndicate project.

Decisions, and what they cost

Route by category, and page only on what matters

Every alert lands in a channel named for what it is about, and Zabbix routes by host group and severity. The cost is that a real warning-level problem can sit unread until I look at a dashboard. I chose signal over completeness, and I cover the gap with dashboards I check on purpose.

Every Grafana alert goes out two ways

While testing, Grafana’s “Test contact point” button got a rate-limit error from Discord. The same webhook, called from my own network at the same moment, returned a clean success. The cause is that Grafana Cloud’s alert traffic leaves from an IP shared across customers, and Discord can rate-limit that IP for reasons that have nothing to do with my alerts. I can’t fix that.

So each Grafana contact point now has two integrations: the direct Discord webhook and a webhook to an n8n workflow on my own infrastructure, which posts the alert from my own IP. During a real test alert, it reached Discord only through the relay while the direct integration failed. The relay is protected by a header token, and a request without it gets a 403.

The relay builds proper Discord embeds, because Discord only renders links and field layouts inside embeds and my first plain-text version showed links as literal brackets. It uses the same colours as my scripts, so an alert looks the same whether Grafana or a Bash script sent it. It links to a dashboard only when the alert name matches a known one, and adds no link otherwise. My first version defaulted to the memory dashboard, which was wrong for every RabbitMQ alert until I noticed in a live screenshot.

Alert on logs instead of polling with a script

Nextcloud used to be watched by a script that polled its log and posted a report. I replaced it with a Loki rule that reads Nextcloud’s structured log and alerts on its numeric level. The container’s own output only carried supervisor noise, so I added a small local Alloy component on that host to tail the real application log file. Deleting the script removed one more thing that could fail quietly.

Watching the watchers

  • Workflow errors: every n8n workflow is wired to a watchdog that reports its failures to Discord, so the automation I rely on cannot break without me hearing about it.
  • Certificate expiry: a daily check of the wildcard certificate, alerting at seven days or fewer, independent of the pipeline that renews it.
  • Credential expiry: I keep sixteen API credentials for the services I automate, and nothing watched them. I built a check that asks each service about its own token and warns before one expires.

Things that looked fine and were not

Monitoring that collected nothing

Zabbix web scenarios for my public URLs were configured, but the poller that runs them never collected a single data point. There was no error, only an empty graph. I found it while documenting the setup. I have not fixed it yet. The plan is to replace the scenarios with HTTP-agent items.

Dashboards that were not coverage

For a while only the Raspberry Pi KVM had alert rules. Every other host had dashboards, which feel like monitoring, but a filling disk on any other machine would have alerted nobody. That is why I wrote the fleet-wide rules.

A relay that nobody was watching

By the time the relay was carrying real alerts, it was the one workflow I had not connected to my own error watchdog. It is now central to my alert delivery, so it must not fail silently. That is next on my list.

What I would still fix

  • Connect the Grafana relay to the workflow error watchdog.
  • Replace the Zabbix web scenarios so that public URLs are actually checked.
  • The script-level layer has a hard dependency on its broker with no fallback path, which is why the other two layers must stay independent of it.
  • The CCTV recorders at both sites are not in monitoring yet.

Stack

Zabbix 7.4 with PostgreSQL and nginx, Grafana Cloud (free tier) with Alloy, Prometheus, Loki and unified alerting, n8n, RabbitMQ, Discord (bot and webhooks), Telegram, Gmail, SNMP, and Bash.