Sentinel workflow

Choose what to watch and how often. Sentinel then checks the servers by itself, and an agent turns each result into a short list of issues to work through.

The Workflow page showed Wingman as a tool for work the administrator starts: a task, a series of approved commands, a report. Much of system administration, though, is noticing a problem before a user does: a disk that fills up, a RAID array that loses a drive, a service that died in the night. Sentinel is the part of Wingman for that work. It runs read-only check scripts on the servers on a schedule, has an agent read every result, and keeps a list of issues, the problems it found, until somebody fixes them. This page first switches Sentinel on, once, and then follows the three phases of the work: setting up the checks, letting them run, and working on the issues.

Switching Sentinel on

Sentinel’s scheduler is part of the Wingman service and needs no setup, but the Sentinel agent, which reads every run, does. Without the agent, the checks run and keep their output, and nobody analyses it. The administrator switches the agent on once, on the machine that runs Wingman:

  1. Build the agent’s container image

    The Sentinel agent runs in a podman container of its own, one per analysis, so the machine needs rootless podman and the agent’s image. One command builds the image; it needs network access the first time and runs again after every update of Wingman:

    itp3wingman build-agent-image
    
  2. Connect the agent to a model

    The agent reaches its model through LiteLLM, a gateway that offers many models behind one interface. Three settings in the sentinel section of ~/.config/itp3wingman/config.yaml switch the analysis on and name the gateway and the model:

    sentinel:
      agent:
        enabled: true
        litellm_url: https://llm.example.invalid
        model: qwen3.8-27b
    

    The gateway’s key goes into the file litellm-key beside config.yaml.

  3. Choose where alerts go

    For a critical issue Sentinel sends an alert right away. The notify part of the same section names a Mattermost channel or users, e-mail recipients, or both; the Sentinel details page lists every setting.
  4. Check and restart

    A check of the configuration and a restart of the service complete the setup:

    itp3wingman check-config
    systemctl --user restart itp3wingman.service
    

    The Sentinel overview in the dashboard then no longer says that the agent analysis is off.

Setting up a check

A check in Sentinel is a task: one script, the list of servers it runs on, and a schedule. The administrator sets a task up once in the dashboard’s Sentinel page, and from then on Sentinel runs it without asking.

  1. Start from a template

    Most servers need the same handful of checks, so Wingman ships ready-made scripts for them, the templates. The Templates tab of the Sentinel page lists them with what each one checks and which tasks already use it:

    The Templates tab of the Sentinel page: one row per packaged template, among them Docker services, File server storage, Gateway security, Server health, Mailcow mail server, Slurm cluster and Vulnerable software, each with a ROOT tag, its description and the number of tasks and hosts that use it. (enlarge)
    The packaged templates. Each row says what the script checks and how many tasks and hosts use it.

    The templates cover the common kinds of server:

    • Server health for every server: disks, memory, load, failed services, time synchronisation, kernel errors, pending updates and the sensors of the server’s management controller.
    • File server storage for file and backup servers: hardware RAID controllers, ZFS pools, software RAID, the health of every drive, and the NFS and Samba services.
    • Docker services for container hosts: the Docker daemon and every container group with its state and restarts.
    • Gateway security for a server reachable from the internet: open ports, logins, accounts and keys, and signs of a break-in.
    • Mailcow mail server for the mail server: its containers, the mail queue, the TLS certificate, DNS records, blocklists and backups.
    • Vulnerable software for every server: release support, the running kernel, pending security updates, and the installed packages, which are looked up for known security holes.
    • Slurm cluster for every host of the compute cluster: the Slurm daemons, node and queue state, InfiniBand ports and GPUs.

    Every template only reads, runs as root, and works on current Debian and Ubuntu releases. Thresholds and paths sit as variables at the top of each script, for example the fill level at which a disk counts as full, so the administrator adapts a template instead of writing a check from scratch.

  2. Choose the servers and the schedule

    The button New task from this template on a template’s row opens the editor for a new task. A task is a template put to use: it starts with an editable copy of the template’s script, and the administrator adapts the copy where needed. The administrator then picks the servers the task runs on from master data, by name or by a tag such as storage, writes a short briefing for the Sentinel agent — what is normal on these servers and what counts as critical — and chooses a schedule. The following screenshot shows the editor for a nightly storage check on both file servers:

    The Add task editor of the Sentinel page: name and description fields, a host picker with storage-01 and storage-02 ticked, a briefing about the RAID controller and the ZFS pool, the File server storage script, the ticked boxes Run as root with the host's stored sudo password and Enabled, a cron schedule 30 3 * * * with each host up to 30 minutes later and the next five runs, the agent analysis setting After every run, and Save and Cancel buttons. (enlarge)
    A task combines a script, the servers it runs on, a briefing for the agent and a schedule. The editor previews the next runs.

    The schedule, which decides when the task runs on each of its servers, takes one of four forms:

    • Random, on average every N minutes, so that the times cannot be predicted;
    • Every N minutes, optionally varied by a percentage;
    • Cron expression, a fixed time of day or week in the notation of the Unix cron scheduler, optionally with each server starting up to N minutes later, so that a fleet does not start all at once;
    • Manual only, for a task that runs only when asked.

    A last setting decides when the agent reads a run: After every run, Only when the output changed since that server’s previous run, or Never. The middle option keeps the cost of the analysis down for tasks on many servers.

  3. Save, which approves the script

    Saving the task approves its script once, and its runs then need no card. This is the point where Sentinel differs from the rest of Wingman, and it is safe only because the script is fixed: Sentinel runs exactly the saved text, on the listed servers, and any change to it is another decision in the same editor.

    A task that runs as root uses each server’s sudo password from Wingman’s vault, the encrypted store the Workflow page introduced. After a restart the vault is locked until the administrator unlocks it, and until then Sentinel skips the root runs and sends nothing to the servers.

Letting the agent propose a check

The administrator can also ask the Wingman agent for a check, as in this prompt:

Prompt to the agent:

Add a Sentinel check that warns when the last restic snapshot on storage-01 is older than 36 hours.

The agent looks at the existing tasks and templates, writes a script and proposes the task. The proposal arrives on the Approvals page as a card like any other request, with the servers, the schedule, the briefing and the full script:

An approval card for a proposed Sentinel task named Backup freshness on storage-01, tagged ROOT: the agent's reason, the schedule cron 0 9 * * * with up to 20 minutes per host, the next runs, timeout 60 s, analysis changed, the eight-line script with syntax highlighting, a note that approving also runs it once now, a command risk of 11 % not flagged, and the buttons Allow once and Reject. (enlarge)
A task the agent proposes waits for the administrator like any command. Allowing it saves the task and, if the agent asked for it, runs it once.

A proposal always needs a person: no policy rule and no permanent approval can allow one, so the agent can suggest checks but never start one on its own.

What happens on each run

Once a task is saved, its runs need no attention. When a task falls due on a server, Sentinel sends the script, keeps the complete output as a run, and hands the run to the Sentinel agent. The agent reads the output against the task’s briefing and the server’s entry in master data, and gives the run a verdict: ok, issues or critical, with a summary of two or three sentences. The Runs tab lists every run with its verdict, and opening one shows the summary, the lines the script itself flagged with !!, and the full output:

An opened Server health run on storage-01: status succeeded, verdict CRITICAL, duration 1.4 s, run as root; the analysis summary that the backup volume /srv/backup is 98 % full and the nightly backups will fail within days; links to the issues citing the run; three flag lines; and the full sectioned output with disks, memory, load, services, time, errors, updates, the management controller and storage. (enlarge)
One run of the Server health check. The agent’s verdict and summary sit above the lines the script flagged and the full output.

The agent then flags each specific problem in the run as an issue: one problem with an urgency and the list of servers it affects. Before filing one, the agent checks whether the issue tracker, Sentinel’s list of open issues, already holds an issue that describes the same problem. If it does, the agent only updates that issue and adds the server to it; otherwise it files a new issue. The same problem on ten servers is therefore one issue with ten servers, not ten issues. When a later run shows the problem gone on a server, the agent clears that server, and the issue resolves by itself once no server has it. The urgency says how soon to act:

  • critical: needs an administrator now, such as a full disk that a service needs, a degraded RAID array, or signs of an intrusion;
  • warning: will become a problem without attention, such as a filesystem above 90 %;
  • todo: maintenance to do at some point, such as pending updates or a reboot into a new kernel;
  • info: worth knowing, no action needed.

For a critical issue the agent also alerts the administrator right away: Wingman posts the alert to a Mattermost channel or to named users, or e-mails it, to the recipients set in its configuration. Every alert has the same parts, and the Messages tab keeps each one with its delivery result:

An alert on the Messages tab of the Sentinel page, tagged ALERT and CRITICAL, for storage-01: the subject line, the affected host, the problem that /srv/backup is 98 % full, the details with the free space and its growth, the possible fixes, the delivery by Mattermost and e-mail both sent, and buttons to open the issue and the run. (enlarge)
An alert names the hosts, the problem, the evidence and possible fixes, and links to the issue.

Reading the issues

The Sentinel overview is the place to start a day: tiles count the open issues per urgency, the most important issues follow, and a table shows every server with its open issues and its last run:

The Overview tab of the Sentinel page: a green ACTIVE bar with the Mattermost alert channel; tiles counting one critical, two warning, three todo and two info issues, the tasks and no host without a task; the most important issues, the critical backup volume first; and a host table with the open issues per urgency, the tasks and the last run of each fictional server. (enlarge)
The Sentinel overview: what is open, how urgent it is, and which servers it concerns.

The Issues tab lists the issues themselves. Opening one shows its text, the servers it affects with when each was first and last seen, the runs it cites, and a timeline of everything that happened to it. The administrator can edit an issue, clear it on one server, Resolve on all hosts, or add an issue by hand. Two issues that turn out to describe the same problem, for example pending security updates found by two different tasks, are ticked and joined with Merge selected:

The Issues tab of the Sentinel page with eight open issues sorted by urgency, from a critical backup volume over two warnings and three todos to two infos. Two todo issues about security updates are ticked, and a bar above the filters says 2 issues selected with the buttons Merge selected and Clear selection. (enlarge)
Two issues that describe the same problem are ticked for merging. The merged issue keeps all their servers and the highest urgency.

Working on an issue with Wingman

Sentinel only finds problems; fixing one is ordinary Wingman work, with a person approving every command. The connection between the two is a button in the dashboard. Fixing the full backup volume from the example takes the following steps:

  1. Hand the issue to the agent

    In the dashboard, Issues on the Approvals page lists the open issues by urgency, and Work on this hands the selected issue to the agent’s running OpenCode session:

    The Open issues dialog on the Approvals page: a note that the agent reads the issue and proposes first steps and runs nothing until the administrator agrees, a Send to selector with the OpenCode session, tabs for the urgencies, and the critical issue Backup volume /srv/backup almost full on storage-01, marked Sent to Wingman, with a Work on this button. (enlarge)
    The issue goes to the agent’s session with one click; the timeline of the issue records the handoff.
  2. Let the agent read up

    The agent receives a prompt that names the issue. It reads the issue, the runs that show it, and the pages about the affected servers in the admin wiki, a folder of Markdown pages in the agent’s workspace that describes the servers, the services and planned changes. Then it reports what it understands and proposes first steps; it runs nothing until the administrator agrees.
  3. Approve the plan and let Wingman fix the issue

    The fix has several steps, and one of them, deleting old backups, cannot be undone. The agent therefore writes a plan into the wiki, a page with the goal, the steps, the verification, the way back and the risks, and asks the administrator to approve it. The administrator reads the plan in Obsidian, the Markdown editor in which the wiki opens, answers the agent’s question in the terminal, and approves the plan there. The agent then works through the plan one approved command at a time:

    The OpenCode terminal with the Wingman agent: it wrote the plan and asked the administrator to approve it in Obsidian; the administrator answered that the plan is approved; the agent read the plan, ran step 1, a check that no backup is running, and submitted step 2, a dry run of restic forget as root using the vault entry backup-repo, which now waits in the dashboard. (enlarge)
    The agent works through the approved plan. Step 2, a dry run that needs a stored password, waits for the administrator’s decision in the dashboard.
  4. Close the issue

    When the fix is done, the agent resolves the issue with a comment saying what it did, and the next Sentinel run on the server confirms the fix or reopens the problem as a new issue.

Feedback

Every heading, paragraph, list item, figure and table on this page now has a short label in the margin, such as sw14. The label lets you point at the exact passage you mean.

A later version may number the page differently, so clicking a label copies it together with the version, as in sw14@70e35cc92aed.

For a correction, a suggestion or a question, paste the copied labels into an email to the address above and add what you would change or want to know.

The labels stay on as you move between pages. Press Labels off in the footer to hide them.