KORTHVEILSecurity firewall
Guides

Log warnings: Korthveil watches the machines that send their logs

Download as PDF All guides

The machines behind your firewall say in their logs when they are in trouble. Korthveil's Syslog server reads every message they send and warns you, by alert, email and push, when a machine:

  • runs out of memory and programs are killed;
  • has a kernel crash or lockup;
  • reports hardware, disk or file-system errors, or a full disk;
  • runs hot or reaches a critical temperature;
  • has programs crash or services fail;
  • restarts without a clean shutdown (a crash or a power cut);
  • stops sending altogether.

The collected logs never fill the firewall's disk: Korthveil always keeps the free space it needs to run.

Where: Monitoring › Logs & audit › Syslog server

Log warnings: each machine in trouble, how often, and its last message
Log warnings: each machine in trouble, how often, and its last message

You need:

  • the Syslog server add-in, turned on, listening in the zone your machines are in (Monitoring › Logs & audit › Syslog server › Settings: Protocols and Listen in zones). Tick TLS so the logs travel encrypted;
  • on each Linux machine: rsyslog (every major distribution has it) and a few minutes with sudo.

Step 1: Send a Linux machine's logs to Korthveil

Under Sending to Korthveil › A Linux machine (rsyslog), Korthveil writes the file for you.

The rsyslog file for a Linux machine, pinned to this firewall's certificate
The rsyslog file for a Linux machine, pinned to this firewall's certificate
  1. Choose the Firewall address the machine reaches, and Send over: TLS (encrypted, recommended).
  2. Keep Heartbeat every 5 minutes ticked: with it, Korthveil also notices a machine that goes silent.
  3. Press Download 90-korthveil.conf and Download the certificate, and copy both files to the machine.
  4. On the machine, in the folder with the two files, run the commands the page shows:
    • the first installs rsyslog's TLS support;
    • rsyslogd -N1 checks the file before rsyslog restarts;
    • logger sends a test message, which appears in the page's messages within seconds.

What the file does:

  • Everything is sent, with the machine's own time stamps.
  • Only this firewall is trusted. The machine accepts this firewall's certificate and nothing else, checked by its fingerprint as well.
  • Nothing is lost while the firewall is away (an update, a restart): messages wait on the machine's disk, at most 256 MB, and also across the machine's own restart.
  • A heartbeat every 5 minutes says the machine is alive. You see it as a short -- MARK -- line in the machine's own logs.

Step 2: Read the warnings

Log warnings lists every machine in trouble:

  • the severity: critical or warning;
  • what is wrong, with the machine's name and address;
  • how often and between which times;
  • what was affected: the programs killed, the disks, the services;
  • the last message, with passwords and keys removed.

Show this machine's messages opens its logs.

Heartbeats lists the machines that send them:

  • sending: all is well;
  • quiet: nothing for 15 minutes, though the machine did not say it was shutting down;
  • shut down or asleep: it said goodbye, so the silence is expected.

A warning stays for 6 hours after its last message, then it ends by itself. When you have fixed the cause, press Clear (or Clear all) to end it now. It comes back only if the machine reports the trouble again.

One machine's logs (from 1.4.1)

The Machine row above the filters picks All machines or one machine: its name and address, with how many messages it sent (a list when more than 12 machines send). The messages panel then reads, for example, Messages from nas01 (172.31.77.101), and every filter applies to that machine only. In the Senders table, Show messages on a machine's row does the same and scrolls to its messages. The address of the page keeps the choice (?sender=), so a link to one machine's logs opens on it; the links in the log warnings do.

One machine's logs: the Machine row and the Senders table
One machine's logs: the Machine row and the Senders table

Step 3: Get the alerts where you are

Each warning is also an alert in Monitoring › Alerts, under the check Warnings in the logs other machines send to the syslog server.

The warnings as alerts in Monitoring › Alerts
The warnings as alerts in Monitoring › Alerts
  • Critical warnings are always sent to the alert destinations you set there: email, push (ntfy), webhooks, SNMP traps.
  • Warnings (corrected hardware errors, running hot, graphics card errors, crashed programs, failed services) are sent when Also send warnings is ticked there.
  • An unacknowledged critical alert is sent again every 24 hours while it lasts.

Choose the warnings

Under Settings › Log warnings:

Each warning with its own switch, and the times
Each warning with its own switch, and the times
  • Each warning has its own switch. Turn one off if a machine reports something you know about (for example a disk you are replacing).
  • Quiet after (minutes): how long a machine with heartbeats may be silent before it is reported (5-1440, default 15).
  • Keep a warning (hours): how long a warning stays after its last message (1-168, default 6).
  • Do not watch: senders whose messages are stored but not read for warnings. The firewall's own logs are never read for them: it watches itself with its own checks.

Press Save to pending changes and commit.

Warning Severity What it means
Out of memory critical The kernel, systemd-oomd or earlyoom killed a program to free memory. During builds: give the build fewer jobs, or the machine more memory.
Kernel crash critical The kernel hit a bug (oops, BUG, panic). The machine may hang or restart.
Kernel lockup critical A processor or task stalled for many seconds. Often comes before a hang.
Hardware errors critical Uncorrected memory, processor or PCIe errors. Test the memory, check the part.
Corrected hardware errors warning Errors the hardware corrected. Many of them mean a part is failing.
File system errors critical Corruption, or a file system made read-only. Back up, then check the disk.
Disk errors critical Read and write errors, timeouts, failing SMART health. Back up now.
Disk full critical A program could not write: no space left on a device.
Critical temperature critical A processor, disk or graphics card reached its critical temperature. The machine may switch itself off.
Running hot warning The processor slowed down because it was hot, or a disk passed its temperature limit. Check the fans and the dust.
Graphics card errors warning The graphics card hung, was reset, or fell off the bus.
Programs crashed warning Programs crashed (segmentation faults, core dumps). Compilers crashing during builds can mean bad memory or overheating.
Services failed warning systemd services, sockets, mounts or timers failed.
Unexpected restart critical The machine started again without saying it was shutting down: a crash, a power cut, or a forced restart.
Stopped sending critical A machine with heartbeats went silent without a goodbye. It may have hung or crashed, or lost its network.

The firewall's disk never fills

While the collected logs are kept on the firewall's own disk, Korthveil checks its free space every minute against Keep free on the firewall's disk (%): 15 % by default, and never less than 1 GiB.

The disk has What Korthveil does
Less free space than that The stored logs stop growing: new messages replace the oldest ones.
Less than half of it New messages are not stored at all until there is room again. The warnings still work.

The page and the add-in's health say when this happens. The File systems nearly full alert reports the disk itself.

On a network volume or in Amazon S3, the logs are not on the firewall's disk. The S3 upload queue keeps the same free space.

Questions

Does Korthveil read my machines' logs for anything else? No. The warnings are found on the firewall. Nothing is sent anywhere except the alerts you set up.

A machine is shut down every night. Will it be reported as quiet? No. A machine that shuts down or goes to sleep says so in its logs, and the silence after that is expected.

The firewall itself restarted (an update). Will every machine be reported as quiet? No. After the firewall starts, each machine gets the full quiet time to be heard again. Its messages from while the firewall was away arrive from its disk queue.

Windows machines and network devices? Their logs are collected and searchable today. The warnings read Linux machines' signs; other systems' signs come later.

Download as PDF All guides