SabaKore

Home / Articles / Use cases

Running a Monitoring System on Your Own VPS

The fundamental problem with running your own monitoring, and how to avoid it. This article also covers the specs you need and how to split the work with external services.

Ren, a junior infrastructure engineer

Ren

I can set up monitoring myself too! I'll put it on my VPS right away!
Procura, a cloud AI robot who explains

Procura

Wait. Where you put it matters. If you put monitoring in the same place as the server you want to monitor, a fundamental problem arises.

Don't put it on the same server

If the thing being monitored and the monitor are on the same server, the notifications stop together with that server when it goes down. It's built so that it goes quietest at the very moment you most want to know. Decide first whether to put it somewhere else or combine it with an external service.

  • The server goes down, so monitoring goes down, so no notification is sent
  • The network is cut, so likewise no notification arrives
  • Then monitoring has no point
  • As a rule, put monitoring outside the thing being monitored

Where to put it

  • On a VPS from a different provider (lowers the chance both go down at once)
  • On a PC at home or a small device
  • Combine it with an external monitoring service
  • If you have several servers, have them monitor each other
Procura, a cloud AI robot who explains

Procura

The fourth is efficient. Server A monitors B, and B monitors A. If either goes down, the other tells you. No additional contract is needed.

Specs you need

Procura, a cloud AI robot who explains

Procura

The monitoring system itself is often light. It only accesses things at regular intervals and records the results, so even the smallest plan runs it well.
  • If you have only a few things to monitor, the smallest setup is enough
  • If you keep records for a long time, allow capacity for that
  • Check that the mechanism that sends notifications works
  • You don't need to rent a large plan just for monitoring

Dividing the work with external services

Procura, a cloud AI robot who explains

Procura

Self-hosted monitoring has a weakness too. When everything on your side goes down, nobody tells you. So the realistic approach is to use just one free external service alongside it.
  • External service: leave it only the minimum liveness monitoring (checking that things are running)
  • Your own monitoring: the finer items and internal values
  • With both, you can notice even if one stops
  • Send notifications from both to a place you normally look
Procura, a cloud AI robot who explains

Procura

Having your own monitoring also has the advantage that the records stay with you. The free tier of an external service often keeps data for a short time, but with your own you can keep it as long as capacity allows.

What to monitor

Procura, a cloud AI robot who explains

Procura

When you set it up yourself, you can add as many items as you like. But the more you add, the more notifications there are, and you stop reading them. Keep it narrow at first.
  • Whether the site or service responds
  • Free disk space
  • The state of memory and swap
  • Certificate expiry dates
Procura, a cloud AI robot who explains

Procura

Run with these four, and add items when something actually causes you trouble. Adding from real experience of trouble lasts longer and is more useful.

Where notifications go

A notification only has meaning once it is sent to a place where you will notice it. Even if you send it to email, someone who doesn't normally check email won't notice. Conversely, if you send too many, you stop reading them and real problems get buried. Deciding where to send them and narrowing the conditions for sending is worth doing before adding more monitoring items.

  • Send them to a place you normally look
  • Don't send them from the monitored server itself
  • After setting up, always test that they arrive
  • Once a month, check that notifications are still working
Ren, a junior infrastructure engineer

Ren

Monitoring goes outside the thing being monitored. And having two servers monitor each other is an option too.

This article is translated from the Japanese original. If the two differ, the Japanese version is the one we keep up to date.