Server monitoring: RAM, disk, clocks, OOM and backups

MemAvailable, available bytes and inodes, relative clock bounds and current-boot OOM. Separate collected metrics from healthy and avoid using mtime as backup completion.

A green server has an amber indicator; memory, a disk, a clock and a transparent stand sit nearby.

Working HTTPS is only part of server health

A website response does not show how much memory processes can use, whether inodes remain or whether the clock agrees with trusted time. I complement protected HTTP checks with a separate host observation command. It reads metrics and compares them with explicit policy; it does not automatically restart services, remove files or change limits.

Use MemAvailable for the memory check

RAM serves both processes and caches. A small MemFree value alone does not establish memory pressure. I use MemAvailable for the initial check; MemTotal and swap counters remain separate fields. Values from /proc/meminfo are converted from kB to bytes.

The Linux procfs documentation explains these counters. Monitor policy defines a minimum MemAvailable reserve. This is a reporting threshold, not a new memory cap for PHP or the host. Zero swap is not turned into an invented failure.

Space and inodes are separate boundaries

Free gigabytes cannot help a filesystem create files when it has run out of inodes. Each selected directory therefore needs both measurements. Available bytes use f_bavail, excluding blocks reserved for privileged use; inode availability uses f_favail.

The directory is opened without traversing symbolic links. Multiple directories on one disk are not added into an imaginary aggregate capacity. If a filesystem supplies no usable inode measurement, that check remains unavailable.

The OOM counter belongs to its boot

I read the exact oom_kill key in /proc/vmstat. This is cumulative kernel accounting; it does not identify event time or the responsible service. The result carries the current boot identity so values after reboot cannot silently be compared with the preceding boot.

A nonzero counter does not mean an OOM just happened. Event frequency requires separate observations with time references. The initial monitor neither restarts anything nor resets counters: it compares the cumulative value with an explicit threshold.

Account for the observation interval when checking time

NTPSynchronized reports whether the kernel considers time synchronized. The systemd-timedated interface documents this property; it is not a separate NTP-server reachability check. The monitor reads it without enabling NTP or setting time.

The server also returns its own time sample. On the laptop I retain the beginning and end of the entire request. These define a possible clock-offset interval instead of guessing an offset from half the delay. The entire interval must fit policy tolerance. If it crosses the boundary, the conclusion remains inconclusive. The laptop clock is an accepted reference here, not an independently verified UTC standard.

Backup age does not come from mtime

Copying or touching an old file can make its modification time look new. Age checking requires a separately accepted reference: this host, exact capture metadata, the exact encrypted file and an attested completion time. The monitor checks metadata and ciphertext size/hash through the existing recovery mechanism. It needs no private recovery key.

The completion time is an explicit operator attestation protected by the separately accepted hash. The current capture format does not contain that timestamp. Without a prepared reference, the result is unavailable. Even a fresh local encrypted copy does not establish offsite presence or a successful restore.

Commands for manual observation

I used these standard commands before the CLI. They read counters without changing configuration.

awk '/^(MemTotal|MemAvailable|SwapTotal|SwapFree):/ {print}' /proc/meminfo
df -B1 --output=size,avail /
df --output=itotal,iavail /
awk '$1 == "oom_kill" {print}' /proc/vmstat
timedatectl show --property=NTPSynchronized --value

Selected unchanged response lines from that manual observation:

MemTotal:        1984348 kB
MemAvailable:    1706552 kB
SwapTotal:             0 kB
SwapFree:              0 kB
oom_kill 0
yes

Collection and health are different results

This invocation uses placeholders; it is not a raw execution transcript:

deploy-cli host health \
  --profile <HOST_PROFILE> \
  --env-file <PRIVATE_ENV> \
  --request-file <ADMIN_REQUEST> \
  --machine-sha256 <ACCEPTED_MACHINE_SHA256> \
  --policy-file <HEALTH_POLICY>

Status observed means collection and admission completed. Individual checks report healthy, warning or unavailable. Overall success requires all required evidence; a missing backup reference retains attention and a nonzero exit code. The command installs no timer, sends no messages and does not describe a single observation as continuous monitoring.

What the educational E-01 reported

On the rented E-01 I first read the metrics with standard commands, then ran the CLI observation and a separate repeat. Both CLI observations belonged to the same host and current boot. Available memory, space and inodes met the selected thresholds; oom_kill was zero. This is a current-boot value, not a promise that OOM cannot occur later.

NTPSynchronized was yes. In the first CLI observation, the clock-offset interval relative to the laptop was -23 to +774 ms, within the selected tolerance. This is one observation interval; it does not mean the server was exactly 23 ms behind or exactly 774 ms ahead.

A separate control with an incorrect machine pin stopped before collecting metrics. No backup reference was supplied in this run: its state remained unavailable/not-configured, overall health was attention and the exit code was 1. The nonzero exit preserves important missing evidence even though the other measured boundaries met policy.

The screenshot below summarizes selected saved results from this E-01. It is not a new execution or a complete raw transcript. There were no restarts, configuration changes, timer installation, messages or backup uploads.

Selected saved results from the rented E-01: standard commands, CLI and repeat. A native VTE summary, not a new execution or complete raw output. The backup reference is unavailable, so overall health is attention.
  1. Observability E-01 resources before public access: RAM, disk and swap
  2. Operations & Security Encrypted E-01 backup and a local recovery drill
  3. Operations & Security CLI backup and recovery: from 27 files to a working build
  4. Operations & Security On-demand E-01 checks: the server, Cloudflare and 20 responses