Linux Labs

Observability: metrics, alerts, logs / Stage 7 of 9 · step 6 of 7

The second machine's logs are not on the collector

medium ~30 min
Not running Starting usually ~20 s
Report a problem

Situation

The team collects the logs of all servers in one place — on node1. The collector is rsyslog: it sorts the lines of other machines into directories, one per machine — /var/log/remote/<machine name>/syslog.log. Yesterday node2 was connected to it: there rsyslog forwards to node1 everything that lands in its journal. Last night something happened on node2, and the collector has not a single line from it — not even the /var/log/remote/node2 directory.

node1 is your terminal. student logs in to node2 with a key: ssh node2 'command' or ssh node2, back — exit. sudo works without a password on both machines. The collector directory is readable with sudo.

Task

  1. A line written by logger on node2 shows up on node1 in /var/log/remote/node2/ within a few seconds.
  2. On node1 the logs are taken by rsyslog on the standard syslog port — 514: other machines will be connected to it too.
  3. The node1 firewall stays on: open in it only what the log intake needs.
  4. The setup survives a reboot of both machines.

Constraints

  • The check itself writes a logger line with its own tag on node2 and looks for it on node1. It also sends its own lines from node2 to node1:514 directly and opens an extra port on node1 for a moment — to make sure the firewall keeps it closed.
  • You do not need to reboot the machines for the check: it makes sure the running rsyslog was started with the config from its files and the nftables rules in the kernel are the ones /etc/nftables.conf will load.

There is no Internet in the lab — only the network between node1 and node2. Everything you need is installed on both machines.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • A line written by logger on node2 shows up on node1 in /var/log/remote/node2/ within a few seconds — not checked yet
  • On node1 port 514 is held by rsyslog, on an address node2 can connect to — not checked yet
  • The node1 firewall stays on — it lets traffic reach the log intake, while other ports stay closed to node2 — not checked yet
  • The setup survives a reboot — rsyslog on both machines is enabled and runs the config from its files, the nftables rules in the kernel come from /etc/nftables.conf — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…