Space list (pilot of the gap review): 45 places, eight questions each
gates / gates (push) Successful in 1m58s
gates / gates (push) Successful in 1m58s
Read-only measurement on demo-hp, demo-felhom and Tester 1, two readings. Audit folder documentation/audits/space-list-2026-11-10/ (README, TABLE, MATRIX, evidence, tools). 360 answers: A 294, D 0, K 19, N 47. Register 225 -> 230: R-1368 (host places that only grow: kernels, agent binaries), R-1369 (no written way out of a full disk), R-1370 (no space budget for the host disk), R-1371 (no space alarm; host-disk mail goes to the household), R-1372 (small guest places). A dated line on nine existing rows. Section headings set to the real counts; R-1268 and R-1312 moved to their category's section. STATUS: new Updated paragraph, decisions D67-D70. N100 diary line. Two stale facts corrected in 05-hub-architecture.md and 11-os-updates.md. Nothing was changed on any machine. Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
a6705ceb04
commit
47e372a5f4
56 files changed
+7631
-20
No files matched your search
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Print the text behind every pointer in a table file, so a person can read it.
|
||||
|
||||
Read-only by construction: it opens files for reading and prints. It runs on DooPlex against the
|
||||
git clones only; it never touches a box.
|
||||
|
||||
Usage: check-pointers.py [FILE ...] (default: ../TABLE.md)
|
||||
check-pointers.py --quiet [FILE] (only the verdict lines; rc 1 when a pointer is dead)
|
||||
|
||||
A pointer is a backticked token `PREFIX/path[:line[-line]]` with one of the prefixes below.
|
||||
A pointer is DEAD when the file is missing or the line range lies beyond the end of the file.
|
||||
The script cannot judge whether the line says what the table claims — that is the reader's job.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
AUDIT = os.path.dirname(HERE)
|
||||
REPO = os.path.abspath(os.path.join(AUDIT, "..", "..", "..")) # felhom.eu
|
||||
WORKSPACE = os.path.dirname(REPO)
|
||||
|
||||
PREFIX = {
|
||||
"AG": os.path.join(WORKSPACE, "felhom-agent"),
|
||||
"CT": os.path.join(WORKSPACE, "felhom-controller", "controller"),
|
||||
"CAT": os.path.join(WORKSPACE, "app-catalog-felhom.eu"),
|
||||
"HUB": os.path.join(REPO, "hub", "internal"),
|
||||
"E": REPO,
|
||||
"AR": os.path.join(REPO, "documentation", "architecture"),
|
||||
"RB": os.path.join(REPO, "documentation", "runbooks"),
|
||||
"EV": os.path.join(AUDIT, "evidence"),
|
||||
}
|
||||
TOKEN = re.compile(r"`((?:%s)/[^`:\s]+)(?::(\d+)(?:-(\d+))?)?`" % "|".join(PREFIX))
|
||||
|
||||
|
||||
def main() -> int:
|
||||
args = [a for a in sys.argv[1:] if a != "--quiet"]
|
||||
quiet = "--quiet" in sys.argv[1:]
|
||||
files = args or [os.path.join(AUDIT, "TABLE.md")]
|
||||
seen, dead, total = set(), 0, 0
|
||||
for table in files:
|
||||
with open(table, encoding="utf-8") as fh:
|
||||
text = fh.read()
|
||||
for m in TOKEN.finditer(text):
|
||||
key = m.group(0)
|
||||
if key in seen:
|
||||
continue
|
||||
seen.add(key)
|
||||
total += 1
|
||||
pre, rest = m.group(1).split("/", 1)
|
||||
path = os.path.join(PREFIX[pre], rest)
|
||||
first = int(m.group(2)) if m.group(2) else None
|
||||
last = int(m.group(3)) if m.group(3) else first
|
||||
if not os.path.exists(path):
|
||||
dead += 1
|
||||
print(f"DEAD {key} (no such file: {path})")
|
||||
continue
|
||||
if first is None:
|
||||
if not quiet:
|
||||
print(f"OK {key} (file exists)")
|
||||
continue
|
||||
with open(path, encoding="utf-8", errors="replace") as fh:
|
||||
lines = fh.readlines()
|
||||
if last > len(lines):
|
||||
dead += 1
|
||||
print(f"DEAD {key} (file has {len(lines)} lines)")
|
||||
continue
|
||||
if quiet:
|
||||
continue
|
||||
print(f"OK {key}")
|
||||
for n in range(first, min(last, first + 11) + 1):
|
||||
print(f" {n:>5} {lines[n - 1].rstrip()[:200]}")
|
||||
print(f"pointers: {total} dead: {dead}")
|
||||
return 1 if dead else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Space list 2026-11-10 — guest baseline. READ-ONLY by construction: df, du, find -printf, docker ls/inspect --format (no Env).
|
||||
# Sizes are ALLOCATED bytes (du -B1), not apparent size.
|
||||
# Output: place <TAB> bytes <TAB> entries <TAB> UTC time. Run inside the LXC guest. Never reads file contents; no names below tier/app folders.
|
||||
set -u
|
||||
T() { date -u +%Y-%m-%dT%H:%M:%SZ; }
|
||||
row() { printf '%s\t%s\t%s\t%s\n' "$1" "$2" "$3" "$(T)"; }
|
||||
dub() { [ -e "$1" ] && nice -n 19 ionice -c3 du -sx -B1 "$1" 2>/dev/null | cut -f1 || echo NA; }
|
||||
cnt() { [ -d "$1" ] && find "$1" -xdev -maxdepth 1 -mindepth 1 2>/dev/null | wc -l || echo NA; }
|
||||
if pgrep -x restic >/dev/null || pgrep -x rsync >/dev/null || pgrep -x apt-get >/dev/null; then row "IN-FLIGHT-skip-walk" NA NA; exit 3; fi
|
||||
row "guest:rootfs-used" "$(df -B1 --output=used / | tail -1 | tr -d ' ')" "size=$(df -B1 --output=size / | tail -1 | tr -d ' ')"
|
||||
row "guest:data-volume-used:/var/lib/felhom" "$(df -B1 --output=used /var/lib/felhom | tail -1 | tr -d ' ')" "size=$(df -B1 --output=size /var/lib/felhom | tail -1 | tr -d ' ')"
|
||||
DR=$(docker info --format '{{.DockerRootDir}}' 2>/dev/null); DR=${DR:-/var/lib/docker}
|
||||
row "guest:docker-images-layers:$DR/overlay2" "$(dub "$DR/overlay2")" "images=$(docker image ls -q --no-trunc | sort -u | wc -l) untagged=$(docker image ls -qf dangling=true | wc -l)"
|
||||
row "guest:docker-volumes:$DR/volumes" "$(dub "$DR/volumes")" "all=$(docker volume ls -q | wc -l) anonymous=$(docker volume ls -q | grep -cE '^[0-9a-f]{64}$') unused=$(docker volume ls -qf dangling=true | wc -l)"
|
||||
row "guest:container-logs:$DR/containers/*/*-json.log*" "$(find "$DR/containers" -name '*-json.log*' -printf '%s\n' 2>/dev/null | awk '{s+=$1} END{print s+0}')" "files=$(find "$DR/containers" -name '*-json.log*' 2>/dev/null | wc -l) containers=$(docker ps -aq | wc -l)"
|
||||
row "guest:docker-buildcache:$DR/buildkit" "$(dub "$DR/buildkit")" "NA"
|
||||
row "guest:controller-data-volume" "$(dub "$DR/volumes/felhom-controller-data")" "NA"
|
||||
row "guest:stacks:/opt/docker/stacks" "$(dub /opt/docker/stacks)" "$(cnt /opt/docker/stacks)"
|
||||
row "guest:sys-drive-backups:/var/lib/felhom/sys_drive/felhom-data/backups" "$(dub /var/lib/felhom/sys_drive/felhom-data/backups)" "$(find /var/lib/felhom/sys_drive/felhom-data/backups -maxdepth 2 -mindepth 2 -type d 2>/dev/null | wc -l)"
|
||||
row "guest:journal" "$(journalctl --disk-usage 2>/dev/null | grep -oE '[0-9.]+[KMG]' | head -1)" "storage=$(ls -d /var/log/journal/* >/dev/null 2>&1 && echo persistent || echo volatile)"
|
||||
row "guest:var-log:/var/log" "$(dub /var/log)" "NA"
|
||||
row "guest:apt-cache:/var/cache/apt" "$(dub /var/cache/apt)" "NA"
|
||||
row "guest:apt-lists:/var/lib/apt/lists" "$(dub /var/lib/apt/lists)" "NA"
|
||||
row "guest:tmp:/tmp" "$(dub /tmp)" "$(cnt /tmp)"
|
||||
row "guest:var-tmp:/var/tmp" "$(dub /var/tmp)" "$(cnt /var/tmp)"
|
||||
for m in /mnt/felhom-drives/*; do
|
||||
[ -d "$m" ] || continue
|
||||
mountpoint -q "$m" || { row "drive:$m NOT-MOUNTED (bare folder on the host root disk)" "$(dub "$m")" "$(cnt "$m")"; continue; }
|
||||
b="$m"; [ -d "$m/felhom-data" ] && b="$m/felhom-data" # two layouts exist in the fleet
|
||||
row "drive:$m used" "$(df -B1 --output=used "$m" | tail -1 | tr -d ' ')" "size=$(df -B1 --output=size "$m" | tail -1 | tr -d ' ')"
|
||||
for t in backups/primary backups/secondary backups/offsite-restore backups/offsite-proof backups/restore-undo kept appdata userdata shares; do
|
||||
[ -d "$b/$t" ] && row "drive:$b/$t" "$(dub "$b/$t")" "$(cnt "$b/$t")"
|
||||
done
|
||||
done
|
||||
exit 0
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# READ-ONLY discovery of every place that holds data inside a Felhom guest (LXC).
|
||||
# Sizes, counts and dates only. No file contents of app or household data. Never dumps Env.
|
||||
export LC_ALL=C
|
||||
N="nice -n 19 ionice -c3"
|
||||
sec() { echo; echo "### $*"; }
|
||||
sec "identity"; hostname; date -u +%FT%TZ; grep PRETTY /etc/os-release; cat /etc/felhom-scratch-disposition 2>/dev/null | head -3
|
||||
sec "df bytes"; df -B1 -T -x tmpfs -x devtmpfs -x overlay -x efivarfs 2>/dev/null
|
||||
sec "df inodes"; df -i -x tmpfs -x devtmpfs -x overlay -x efivarfs 2>/dev/null
|
||||
sec "docker info"; docker info --format 'driver={{.Driver}} root={{.DockerRootDir}} logdriver={{.LoggingDriver}} images={{.Images}} containers={{.Containers}} running={{.ContainersRunning}} server={{.ServerVersion}}'
|
||||
sec "daemon.json"; cat /etc/docker/daemon.json 2>/dev/null; ls -la --time-style=long-iso /etc/docker/ 2>/dev/null
|
||||
sec "docker system df"; docker system df 2>&1
|
||||
sec "containers (name image state logdriver logopts)"
|
||||
for c in $(docker ps -aq); do docker inspect --format '{{.Name}} {{.Config.Image}} {{.State.Status}} {{.HostConfig.LogConfig.Type}} {{json .HostConfig.LogConfig.Config}} restart={{.RestartCount}} created={{.Created}}' "$c"; done | sort
|
||||
sec "container log files (bytes path) and total"
|
||||
R=$(docker info --format '{{.DockerRootDir}}')
|
||||
find "$R/containers" -maxdepth 2 -type f -name '*.log*' -printf '%s\t%TY-%Tm-%Td\t%p\n' 2>/dev/null | sort -rn | head -60
|
||||
find "$R/containers" -maxdepth 2 -type f -name '*.log*' -printf '%s\n' 2>/dev/null | awk '{s+=$1;n++} END{print "TOTAL bytes="s" files="n}'
|
||||
sec "container writable layers (docker ps -as)"; docker ps -as --format '{{.Names}} {{.Size}}' | sort
|
||||
sec "images"; docker images -a --format '{{.Repository}}:{{.Tag}} {{.ID}} {{.CreatedAt}} {{.Size}}' | sort
|
||||
sec "images count / dangling"; docker images -q | sort -u | wc -l; docker images -f dangling=true -q | wc -l
|
||||
sec "images in use by a container"; docker ps -a --format '{{.Image}}' | sort | uniq -c
|
||||
sec "volumes (count, anonymous count, dangling count)"; docker volume ls -q | wc -l; docker volume ls -q | grep -cE '^[0-9a-f]{64}$'; docker volume ls -f dangling=true -q | wc -l
|
||||
sec "volumes by size (system df -v, Local Volumes block)"; docker system df -v 2>/dev/null | awk '/^Local Volumes/{p=1} /^Build cache/{p=0} p' | head -150
|
||||
sec "build cache"; docker system df -v 2>/dev/null | awk '/^Build cache/{p=1} p' | head -8
|
||||
sec "docker root du depth 1"; $N du -x -B1 --max-depth=1 "$R" 2>/dev/null | sort -rn
|
||||
sec "journald"; journalctl --disk-usage 2>&1; grep -rhv '^#' /etc/systemd/journald.conf /etc/systemd/journald.conf.d/ 2>/dev/null | grep -v '^$'; journalctl -u systemd-journald --no-pager 2>/dev/null | grep -i 'max\|vacuum\|deleted' | tail -4
|
||||
sec "/var/log"; $N du -x -B1 --max-depth=1 /var/log 2>/dev/null | sort -rn | head -15; find /var/log -xdev -type f -size +5M -printf '%s\t%TY-%Tm-%Td\t%p\n' 2>/dev/null | sort -rn | head
|
||||
sec "apt"; $N du -x -B1 -s /var/cache/apt /var/lib/apt/lists 2>/dev/null; ls /var/cache/apt/archives/*.deb 2>/dev/null | wc -l
|
||||
sec "tmp"; $N du -x -B1 -s /tmp /var/tmp 2>/dev/null; find /tmp /var/tmp -xdev -mindepth 1 -maxdepth 1 -printf '%TY-%Tm-%Td\t%s\t%p\n' 2>/dev/null | sort | head -40; echo "entries=$(find /tmp /var/tmp -xdev -mindepth 1 -maxdepth 1 | wc -l)"
|
||||
sec "felhom dirs"; ls -d /var/lib/felhom* /opt/felhom* /opt/docker /etc/felhom* /var/log/felhom* /var/cache/felhom* /srv/* 2>/dev/null
|
||||
sec "root filesystem top 45 to depth 4"; $N du -x -B1 --max-depth=4 / 2>/dev/null | sort -rn | head -45
|
||||
sec "/var/lib/felhom depth 3 (data volume)"; $N du -x -B1 --max-depth=3 /var/lib/felhom 2>/dev/null | sort -rn | grep -v "/docker/overlay2/\|/docker/volumes/\|/docker/containers/\|/docker/image/\|/docker/buildkit/" | head -70
|
||||
sec "/opt/docker depth 2"; $N du -x -B1 --max-depth=2 /opt/docker 2>/dev/null | sort -rn | head -50
|
||||
sec "drives under /mnt/felhom-drives (depth 3 from each drive)"
|
||||
for d in /mnt/felhom-drives/*; do [ -d "$d" ] && { echo "-- $d"; df -B1 "$d" | tail -1; $N du -x -B1 --max-depth=3 "$d" 2>/dev/null | sort -rn | head -60; }; done
|
||||
sec "timers"; systemctl list-timers --all --no-pager 2>/dev/null | head -20
|
||||
sec "cron"; ls /etc/cron.d /etc/cron.daily /etc/cron.weekly 2>/dev/null
|
||||
sec "end"; date -u +%FT%TZ
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Read-only follow-up inside a guest: controller writable layer, restic cache, guest journal, guest timers.
|
||||
echo "== utc $(date -u +%FT%TZ)"
|
||||
echo "== controller container size (writable layer / virtual)"
|
||||
docker ps -s --filter name=felhom-controller --format '{{.Names}} {{.Size}}'
|
||||
echo "== restic cache folders inside the controller container (size, entries)"
|
||||
docker exec felhom-controller sh -c 'for d in /root/.cache/restic /tmp /var/tmp; do [ -e "$d" ] && echo "$d $(du -sx -B1 "$d" 2>/dev/null | cut -f1) $(ls -A "$d" 2>/dev/null | wc -l)"; done; echo HOME=$HOME; echo XDG_CACHE_HOME=${XDG_CACHE_HOME:-unset}; echo RESTIC_CACHE_DIR=${RESTIC_CACHE_DIR:-unset}'
|
||||
echo "== controller state volume top level (sizes only)"
|
||||
docker exec felhom-controller sh -c 'du -sx -B1 /data/* 2>/dev/null | sort -rn | head -12'
|
||||
echo "== guest journal"
|
||||
ls -d /var/log/journal 2>/dev/null || echo "/var/log/journal absent"
|
||||
journalctl --disk-usage 2>&1 | tail -1
|
||||
df -B1 --output=target,size,used /run | tail -1
|
||||
systemctl is-active logrotate.timer systemd-tmpfiles-clean.timer fstrim.timer apt-daily.timer 2>&1 | tr '\n' ' '; echo
|
||||
findmnt -no FSTYPE /tmp
|
||||
echo "== images with no container, by repository (name only)"
|
||||
docker images --format '{{.Repository}}:{{.Tag}} {{.Size}} {{.CreatedSince}}' | grep -E '^(alpine|hello-world|curlimages|busybox|traefik/whoami)'
|
||||
exit 0
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# Space list 2026-11-10 — host baseline. READ-ONLY by construction: df, du, ls, lvs, find -printf, journalctl --disk-usage.
|
||||
# Sizes are ALLOCATED bytes (du -B1), not apparent size.
|
||||
# Output: place <TAB> bytes <TAB> entries <TAB> UTC time. Run as root on a Proxmox host.
|
||||
set -u
|
||||
T() { date -u +%Y-%m-%dT%H:%M:%SZ; }
|
||||
row() { printf '%s\t%s\t%s\t%s\n' "$1" "$2" "$3" "$(T)"; }
|
||||
dub() { [ -e "$1" ] && nice -n 19 ionice -c3 du -sx -B1 "$1" 2>/dev/null | cut -f1 || echo NA; }
|
||||
cnt() { [ -d "$1" ] && find "$1" -xdev -maxdepth "${3:-1}" -mindepth 1 ${2:+-name "$2"} 2>/dev/null | wc -l || echo NA; }
|
||||
# refuse to walk while a backup / restore / update is in flight
|
||||
if pgrep -x vzdump >/dev/null || pgrep -x apt-get >/dev/null || pgrep -x dpkg >/dev/null || pgrep -f 'pct restore' >/dev/null; then
|
||||
row "IN-FLIGHT-skip-walk" NA NA; exit 3; fi
|
||||
row "host:rootfs-used" "$(df -B1 --output=used / | tail -1 | tr -d ' ')" "size=$(df -B1 --output=size / | tail -1 | tr -d ' ')"
|
||||
lvs --noheadings --units b --nosuffix -o lv_name,lv_size,data_percent,metadata_percent,lv_attr pve 2>/dev/null | awk '$5 ~ /^t/ {printf "%s %s %s %s\n",$1,$2,$3,$4}' | while read n s d m; do
|
||||
row "host:thinpool-$n-data" "$(awk -v s="$s" -v d="$d" 'BEGIN{printf "%.0f", s*d/100}')" "size=$s pct=$d"
|
||||
row "host:thinpool-$n-metadata-pct" "NA" "pct=$m"
|
||||
done
|
||||
for d in $(awk '/^dir:/{f=1;next} /^[a-z]+:/{f=0} f&&$1=="path"{print $2}' /etc/pve/storage.cfg 2>/dev/null); do
|
||||
row "host:dump:$d/dump" "$(dub "$d/dump")" "archives=$(cnt "$d/dump" 'vzdump-*.tar.zst') logs=$(cnt "$d/dump" '*.log') all=$(cnt "$d/dump")"
|
||||
row "host:template-cache:$d/template" "$(dub "$d/template")" "$(cnt "$d/template" '' 2)"
|
||||
done
|
||||
row "host:journal:/var/log/journal" "$(dub /var/log/journal)" "files=$(find /var/log/journal -type f 2>/dev/null | wc -l)"
|
||||
row "host:var-log-other" "$(nice -n 19 ionice -c3 du -sx -B1 --exclude=/var/log/journal /var/log 2>/dev/null | cut -f1)" "pve-tasks=$(find /var/log/pve/tasks -type f 2>/dev/null | wc -l)"
|
||||
row "host:rrdcached:/var/lib/rrdcached" "$(dub /var/lib/rrdcached)" "NA"
|
||||
row "host:kernels:/lib/modules" "$(dub /lib/modules)" "kernels=$(ls /lib/modules 2>/dev/null | wc -l)"
|
||||
row "host:boot:/boot" "$(nice du -sx -B1 /boot 2>/dev/null | cut -f1)" "initrd=$(ls /boot/initrd.img-* 2>/dev/null | wc -l)"
|
||||
mountpoint -q /boot/efi && row "host:esp:/boot/efi" "$(df -B1 --output=used /boot/efi | tail -1 | tr -d ' ')" "size=$(df -B1 --output=size /boot/efi | tail -1 | tr -d ' ')"
|
||||
row "host:apt-cache:/var/cache/apt" "$(dub /var/cache/apt)" "debs=$(cnt /var/cache/apt/archives '*.deb')"
|
||||
row "host:apt-lists:/var/lib/apt/lists" "$(dub /var/lib/apt/lists)" "NA"
|
||||
row "host:agent-state:/var/lib/felhom-agent" "$(dub /var/lib/felhom-agent)" "$(cnt /var/lib/felhom-agent)"
|
||||
row "host:agent-selfupdate:/var/lib/felhom-agent/selfupdate" "$(dub /var/lib/felhom-agent/selfupdate)" "binaries=$(cnt /var/lib/felhom-agent/selfupdate 'felhom-agent-*')"
|
||||
row "host:agent-bak:/usr/local/bin/felhom-agent.bak-*" "$(find /usr/local/bin -maxdepth 1 -name 'felhom-agent.bak-*' -printf '%s\n' 2>/dev/null | awk '{s+=$1} END{print s+0}')" "$(cnt /usr/local/bin 'felhom-agent.bak-*')"
|
||||
row "host:os-apply:/var/lib/felhom-os-apply" "$(dub /var/lib/felhom-os-apply)" "bundle-prev=$(cnt /var/lib/felhom-os-apply/bundle-prev)"
|
||||
row "host:tmp:/tmp" "$(dub /tmp)" "$(cnt /tmp)"
|
||||
row "host:var-tmp:/var/tmp" "$(dub /var/tmp)" "$(cnt /var/tmp)"
|
||||
row "host:root-home:/root" "$(dub /root)" "NA"
|
||||
row "host:swap-used" "$(awk 'NR>1{s+=$4} END{print s*1024}' /proc/swaps)" "size=$(awk 'NR>1{s+=$3} END{print s*1024}' /proc/swaps)"
|
||||
row "host:journal-lines-last-hour" "NA" "all=$(journalctl --since '-1h' -q --no-pager -o cat 2>/dev/null | wc -l) sudo=$(journalctl --since '-1h' -q --no-pager -t sudo -o cat 2>/dev/null | wc -l)"
|
||||
row "host:journal-oldest-entry" "NA" "$(journalctl -q --no-pager -o short-iso 2>/dev/null | head -1 | awk '{print $1}')"
|
||||
exit 0
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# READ-ONLY discovery of every place that holds data on a Felhom Proxmox host.
|
||||
# Sizes, counts and dates only. No file contents. No command here can write.
|
||||
export LC_ALL=C
|
||||
N="nice -n 19 ionice -c3"
|
||||
sec() { echo; echo "### $*"; }
|
||||
sec "identity"; hostname; date -u +%FT%TZ; pveversion 2>/dev/null; felhom-agent --version 2>/dev/null
|
||||
sec "in-flight (must be empty)"; pgrep -af 'vzdump|proxmox-backup-client|restic |apt-get|dpkg |pct restore|qmrestore' | grep -v pgrep
|
||||
sec "lsblk"; lsblk -b -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODEL,TRAN
|
||||
sec "df bytes"; df -B1 -T -x tmpfs -x devtmpfs -x overlay -x efivarfs
|
||||
sec "df inodes"; df -i -x tmpfs -x devtmpfs -x overlay -x efivarfs
|
||||
sec "vgs"; vgs --units b --nosuffix -o vg_name,vg_size,vg_free 2>/dev/null
|
||||
sec "lvs"; lvs --units b --nosuffix -o lv_name,vg_name,lv_attr,lv_size,pool_lv,data_percent,metadata_percent,lv_metadata_size 2>/dev/null
|
||||
sec "thin pool autoextend + monitoring"; lvmconfig activation/thin_pool_autoextend_threshold activation/thin_pool_autoextend_percent activation/monitoring 2>&1
|
||||
sec "pvesm status"; pvesm status 2>&1
|
||||
sec "storage.cfg (no secrets live here; passwords are in /etc/pve/priv)"; grep -v -i 'password\|keyring' /etc/pve/storage.cfg
|
||||
sec "pvesm list per storage (count, bytes, oldest, newest)"
|
||||
for s in $(pvesm status 2>/dev/null | awk 'NR>1 && $3=="active"{print $1}'); do
|
||||
pvesm list "$s" 2>/dev/null | awk -v s="$s" 'NR>1{n++; b+=$4; split($1,a,"/"); k=$3; c[k]++; cb[k]+=$4} END{printf "%s total entries=%d bytes=%d\n", s, n, b; for(k in c) printf " %s type=%s entries=%d bytes=%d\n", s, k, c[k], cb[k]}'
|
||||
done
|
||||
sec "guest configs (disk + mountpoint lines only)"
|
||||
for f in /etc/pve/lxc/*.conf /etc/pve/qemu-server/*.conf; do [ -f "$f" ] && { echo "-- $f"; grep -E '^(rootfs|mp[0-9]+|scsi[0-9]+|virtio[0-9]+|sata[0-9]+|efidisk|tpmstate|unused[0-9]+|memory|swap|\[)' "$f"; }; done
|
||||
sec "vzdump.conf + jobs (keep rules)"; grep -v '^#' /etc/vzdump.conf 2>/dev/null; cat /etc/pve/jobs.cfg 2>/dev/null
|
||||
sec "journald"; journalctl --disk-usage 2>&1; grep -rhv '^#' /etc/systemd/journald.conf /etc/systemd/journald.conf.d/ 2>/dev/null | grep -v '^$'; ls -la /var/log/journal/*/ 2>/dev/null | awk 'NR>1' | wc -l; journalctl --list-boots 2>/dev/null | sed -n '1p;$p'
|
||||
sec "/var/log top"; $N du -x -B1 --max-depth=1 /var/log 2>/dev/null | sort -rn | head -25
|
||||
sec "/var/log big files"; find /var/log -xdev -type f -size +5M -printf '%s\t%TY-%Tm-%Td\t%p\n' 2>/dev/null | sort -rn | head -30
|
||||
sec "logrotate configs present"; ls /etc/logrotate.d/
|
||||
sec "kernels installed"; dpkg-query -W -f='${Package}\t${Version}\t${Installed-Size}\t${db:Status-Abbrev}\n' 'proxmox-kernel-*' 'pve-kernel-*' 'linux-image-*' 2>/dev/null; uname -r
|
||||
sec "proxmox-boot-tool"; proxmox-boot-tool kernel list 2>&1; proxmox-boot-tool status 2>&1 | head -20
|
||||
sec "/boot"; df -B1 /boot /boot/efi 2>/dev/null; $N du -x -B1 --max-depth=1 /boot 2>/dev/null | sort -rn; ls -la /boot | awk '{print $5"\t"$6" "$7" "$8"\t"$9}' | sort -rn | head -30
|
||||
sec "/lib/modules"; $N du -x -B1 --max-depth=1 /lib/modules 2>/dev/null | sort -rn
|
||||
sec "apt"; $N du -x -B1 -s /var/cache/apt /var/lib/apt/lists /var/cache/apt/archives 2>/dev/null; ls /var/cache/apt/archives/*.deb 2>/dev/null | wc -l; apt-config dump 2>/dev/null | grep -i -E 'Periodic|Unattended|AutoRemove|Clean' | head -30; ls /etc/apt/apt.conf.d/
|
||||
sec "apt autoremove candidates (dry read)"; apt-get -s autoremove 2>/dev/null | grep -c '^Remv'
|
||||
sec "tmp"; $N du -x -B1 -s /tmp /var/tmp 2>/dev/null; find /tmp /var/tmp -xdev -mindepth 1 -maxdepth 1 -printf '%TY-%Tm-%Td\t%s\t%p\n' 2>/dev/null | sort | sed -n '1,5p;$p'; find /tmp /var/tmp -xdev -mindepth 1 -maxdepth 1 | wc -l
|
||||
sec "systemd-tmpfiles rules touching tmp"; grep -rh -E '^\s*[dDqQ]\s+/(var/)?tmp' /usr/lib/tmpfiles.d /etc/tmpfiles.d 2>/dev/null
|
||||
sec "/var/lib/vz"; $N du -x -B1 --max-depth=2 /var/lib/vz 2>/dev/null | sort -rn | head -20; for d in /var/lib/vz/dump /var/lib/vz/template/cache /var/lib/vz/template/iso; do echo "-- $d"; find "$d" -maxdepth 1 -type f -printf '%s\t%TY-%Tm-%Td\t%f\n' 2>/dev/null | sort -k2; done
|
||||
sec "felhom dirs (candidates)"; ls -d /var/lib/felhom* /opt/felhom* /etc/felhom* /var/log/felhom* /usr/local/lib/felhom* /var/cache/felhom* /root/.felhom* /srv/felhom* /run/felhom* 2>/dev/null
|
||||
for d in $(ls -d /var/lib/felhom* /opt/felhom* /etc/felhom* /var/log/felhom* /var/cache/felhom* /usr/local/lib/felhom* 2>/dev/null); do echo "-- $d"; $N du -x -B1 --max-depth=2 "$d" 2>/dev/null | sort -rn | head -25; echo " files=$(find "$d" -xdev -type f 2>/dev/null | wc -l) oldest=$(find "$d" -xdev -type f -printf '%TY-%Tm-%Td\n' 2>/dev/null | sort | head -1) newest=$(find "$d" -xdev -type f -printf '%TY-%Tm-%Td\n' 2>/dev/null | sort | tail -1)"; done
|
||||
sec "felhom binaries + slots"; ls -la /usr/local/bin/ /usr/local/sbin/ 2>/dev/null | awk '{print $5"\t"$6" "$7" "$8"\t"$9" "$10" "$11}'
|
||||
sec "root filesystem, top 70 dirs to depth 4"; $N du -x -B1 --max-depth=4 / 2>/dev/null | sort -rn | head -70
|
||||
sec "root fs: file count per top dir"; for d in /var /usr /root /home /opt /etc /srv /tmp; do printf '%s\t%s\n' "$(find $d -xdev -type f 2>/dev/null | wc -l)" "$d"; done
|
||||
sec "root home"; $N du -x -B1 --max-depth=1 /root 2>/dev/null | sort -rn | head -15
|
||||
sec "other mounted filesystems, depth 2"
|
||||
for m in $(df --output=target -x tmpfs -x devtmpfs -x overlay -x efivarfs | awk 'NR>1 && $1!="/" && $1!~/^\/boot/ && $1!~/^\/etc\/pve/'); do echo "-- $m"; $N du -x -B1 --max-depth=2 "$m" 2>/dev/null | sort -rn | head -40; done
|
||||
sec "pve task logs + rrd"; $N du -x -B1 -s /var/log/pve /var/lib/rrdcached /var/lib/pve-cluster /var/lib/pve-manager 2>/dev/null; find /var/log/pve/tasks -type f 2>/dev/null | wc -l; find /var/log/pve/tasks -type f -printf '%TY-%Tm-%Td\n' 2>/dev/null | sort | sed -n '1p;$p'
|
||||
sec "core dumps"; $N du -x -B1 -s /var/lib/systemd/coredump 2>/dev/null; ls /var/lib/systemd/coredump 2>/dev/null | wc -l
|
||||
sec "swap"; swapon --show --bytes 2>/dev/null
|
||||
sec "timers"; systemctl list-timers --all --no-pager 2>/dev/null | head -40
|
||||
sec "end"; date -u +%FT%TZ
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# Space list 2026-11-10 — host follow-up. READ-ONLY by construction: ls, stat, du, cat of scripts, journalctl reads.
|
||||
N="nice -n 19 ionice -c3"
|
||||
echo "### identity"; hostname; date -u +%FT%TZ
|
||||
echo "### in flight"; pgrep -a 'vzdump|restic|proxmox-backup|apt|dpkg|pct restore' 2>/dev/null | grep -v pgrep | cut -c1-160; echo "(end in flight)"
|
||||
echo "### agent state dir (depth 2, bytes)"; $N du -x -B1 --max-depth=2 /var/lib/felhom-agent 2>/dev/null | sort -rn | head -40
|
||||
echo "### selfupdate listing"; ls -la --time-style=long-iso /var/lib/felhom-agent/selfupdate 2>/dev/null | head -60
|
||||
echo "### selfupdate subdirs listing"; for d in /var/lib/felhom-agent/selfupdate/*/; do [ -d "$d" ] && { echo "-- $d"; ls -la --time-style=long-iso "$d" | head -40; }; done
|
||||
echo "### agent state top-level listing (names, sizes, dates only)"; ls -la --time-style=long-iso /var/lib/felhom-agent 2>/dev/null
|
||||
echo "### os-apply state"; $N du -x -B1 --max-depth=2 /var/lib/felhom-os-apply 2>/dev/null | sort -rn | head; ls -la --time-style=long-iso /var/lib/felhom-os-apply /var/lib/felhom-os-apply/bundle-prev 2>/dev/null
|
||||
echo "### usr local bin + sbin"; ls -la --time-style=long-iso /usr/local/bin /usr/local/sbin 2>/dev/null
|
||||
echo "### dumps on drives"; for d in /mnt/*/dump /var/lib/vz/dump; do [ -d "$d" ] && { echo "-- $d"; ls -la --time-style=long-iso "$d"; }; done
|
||||
echo "### template cache"; ls -la --time-style=long-iso /var/lib/vz/template/cache /var/lib/vz/template/iso 2>/dev/null
|
||||
echo "### journald disk usage + limits"; journalctl --disk-usage 2>&1; journalctl -b -u systemd-journald --no-pager 2>/dev/null | grep -i -E 'max|System Journal' | tail -3
|
||||
echo "### journal oldest + newest entry"; journalctl --no-pager -o short-iso -n 1 --reverse 2>/dev/null | tail -1; journalctl --no-pager -o short-iso 2>/dev/null | head -2 | cut -c1-120
|
||||
echo "### journal files (count, oldest, newest)"; find /var/log/journal -type f -printf '%TY-%Tm-%Td %s\n' 2>/dev/null | sort | awk 'NR==1{o=$1} {n=$1; c++; s+=$2} END{print "files="c" bytes="s" oldest="o" newest="n}'
|
||||
echo "### journal bytes exact"; $N du -x -sB1 /var/log/journal 2>/dev/null
|
||||
echo "### journal last hour: lines by identifier (top 12)"; journalctl --since '-1h' --no-pager -o json 2>/dev/null | grep -o '"SYSLOG_IDENTIFIER":"[^"]*"' | sort | uniq -c | sort -rn | head -12
|
||||
echo "### journal last hour: total lines"; journalctl --since '-1h' --no-pager -o cat 2>/dev/null | wc -l
|
||||
echo "### journald conf files"; ls /etc/systemd/journald.conf.d/ 2>/dev/null; grep -v '^#' /etc/systemd/journald.conf 2>/dev/null | grep -v '^$'
|
||||
echo "### thin-check script"; for f in /usr/local/sbin/felhom-thin-check /usr/local/sbin/felhom-vzdump-partial-clean; do echo "-- $f"; [ -f "$f" ] && cat "$f" | head -120; done
|
||||
echo "### units mentioning thin-check / partial-clean"; grep -rl -E 'felhom-thin-check|vzdump-partial-clean' /etc/systemd/system /etc/cron* /etc/sudoers.d 2>/dev/null
|
||||
echo "### lvm thin settings"; lvmconfig --type full activation/thin_pool_autoextend_threshold activation/thin_pool_autoextend_percent activation/monitoring 2>/dev/null; systemctl is-active lvm2-monitor 2>/dev/null
|
||||
echo "### agent config: selected non-secret keys"; for f in /etc/felhom-agent/*.json /etc/felhom-agent/*.yaml /etc/felhom-agent/*.yml; do [ -f "$f" ] && { echo "-- $f"; grep -o -E '"?(local_backup_target|backup_target|keep_daily|keep_last|retention[a-z_]*|local_keep[a-z_]*)"?[ ]*[:=][ ]*[^,}]*' "$f" | head; }; done
|
||||
echo "### vzdump.conf + storage prune settings"; grep -v '^#' /etc/vzdump.conf 2>/dev/null | grep -v '^$'; grep -n -E '^(dir|lvmthin|pbs)|prune|maxfiles|content|path|is_mountpoint|mkdir' /etc/pve/storage.cfg 2>/dev/null
|
||||
echo "### kernels"; dpkg-query -W -f='${Package}\t${Version}\t${Installed-Size}\t${db:Status-Abbrev}\n' 'proxmox-kernel-*' 2>/dev/null | grep -v '^proxmox-kernel-[0-9.]*\s' | head -30; uname -r
|
||||
echo "### apt history: kernel installs/removes"; zgrep -h -E '^(Start-Date|Install|Remove|Purge):' /var/log/apt/history.log* 2>/dev/null | grep -B1 -E 'proxmox-kernel' | grep -E 'Start-Date|Remove|Purge' | cut -c1-200 | tail -24
|
||||
echo "### apt autoremove config"; apt-config dump 2>/dev/null | grep -i -E 'AutoRemove|Unattended|Periodic' | cut -c1-200 | head -30
|
||||
echo "### boot"; df -B1 /boot /boot/efi 2>/dev/null; ls -la --time-style=long-iso /boot | head -40
|
||||
echo "### pve tasks / rrd"; $N du -x -sB1 /var/log/pve /var/lib/rrdcached 2>/dev/null; find /var/log/pve/tasks -type f 2>/dev/null | wc -l
|
||||
echo "### root dir extras"; $N du -x -B1 --max-depth=1 /root 2>/dev/null | sort -rn | head -12
|
||||
echo "### df now"; df -B1 --output=source,size,used,avail,pcent,target / 2>/dev/null; lvs --noheadings -o lv_name,lv_size,data_percent,metadata_percent --units b pve 2>/dev/null
|
||||
echo "### end"; date -u +%FT%TZ
|
||||
@@ -0,0 +1,127 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build MATRIX.md from TABLE.md, and check the table's shape.
|
||||
|
||||
Read-only on everything but MATRIX.md in this folder. It runs on DooPlex against the git clone only.
|
||||
|
||||
Usage: make-matrix.py write ../MATRIX.md, print the totals
|
||||
make-matrix.py --check write nothing; rc 1 when the table breaks a rule
|
||||
|
||||
Rules checked (a broken rule is printed and makes rc 1):
|
||||
- a place heading is `### <ID> — <name> · CUSTOMER · NAMED|MENTIONED|UNNAMED`
|
||||
- each place has exactly eight answer rows, numbered 1..8, each with one mark A, D, K or N
|
||||
- an A row carries a backticked pointer; a K row an `R-<n>`; an N row one class C1..C5 and a search S<n>
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
AUDIT = os.path.dirname(HERE)
|
||||
HEAD = re.compile(r"^### ([HGD]\d+) — (.+?) · CUSTOMER · (NAMED|MENTIONED|UNNAMED)\s*$")
|
||||
ROW = re.compile(r"^\| ([1-8]) \| (.*) \| ([ADKN]) \| (.*) \|\s*$")
|
||||
QUESTIONS = ["what is in it", "what makes it grow", "the limit", "who cleans up", "what happens when full",
|
||||
"who gets an alarm", "self-repair or runbook", "how do we know"]
|
||||
CLASS_ROW = {"C1": "R-1368", "C2": "R-1369", "C3": "R-1370", "C4": "R-1371", "C5": "R-1372"}
|
||||
|
||||
|
||||
def parse(path):
|
||||
places, errors, cur = [], [], None
|
||||
with open(path, encoding="utf-8") as fh:
|
||||
for ln, line in enumerate(fh, 1):
|
||||
if line.startswith("## TEST-ONLY") or line.startswith("## DOC-ONLY"):
|
||||
cur = None
|
||||
continue
|
||||
if line.startswith("### "):
|
||||
m = HEAD.match(line)
|
||||
if not m:
|
||||
errors.append(f"line {ln}: heading has the wrong shape: {line.strip()}")
|
||||
cur = None
|
||||
continue
|
||||
cur = {"id": m.group(1), "name": m.group(2), "named": m.group(3), "marks": {}, "n": {}, "k": {}}
|
||||
places.append(cur)
|
||||
continue
|
||||
m = ROW.match(line)
|
||||
if not m or cur is None:
|
||||
continue
|
||||
q, mark, ptr = int(m.group(1)), m.group(3), m.group(4)
|
||||
if q in cur["marks"]:
|
||||
errors.append(f"{cur['id']}: question {q} is answered twice")
|
||||
cur["marks"][q] = mark
|
||||
if mark == "A" and "`" not in ptr:
|
||||
errors.append(f"{cur['id']}-{q}: A with no pointer")
|
||||
if mark == "K":
|
||||
rows = re.findall(r"R-\d+", ptr)
|
||||
if not rows:
|
||||
errors.append(f"{cur['id']}-{q}: K with no row")
|
||||
cur["k"][q] = rows
|
||||
if mark == "N":
|
||||
cls = re.findall(r"\bC[1-5]\b", ptr)
|
||||
if len(cls) != 1:
|
||||
errors.append(f"{cur['id']}-{q}: N needs exactly one class, found {cls}")
|
||||
elif not re.search(r"\bS\d+\b", ptr) and "NOBODY KNOWS" not in m.group(2):
|
||||
errors.append(f"{cur['id']}-{q}: N with no search id")
|
||||
cur["n"][q] = cls[0] if cls else "?"
|
||||
for p in places:
|
||||
if sorted(p["marks"]) != list(range(1, 9)):
|
||||
errors.append(f"{p['id']}: has answers {sorted(p['marks'])}, wants 1..8")
|
||||
return places, errors
|
||||
|
||||
|
||||
def build(places):
|
||||
out = ["# The Space list — the matrix", "",
|
||||
"Made by `tools/make-matrix.py` from `TABLE.md`. Do not edit it by hand.", "",
|
||||
"`A` answered · `D` decided, not built · `K` known gap (has a row) · `N` nobody asked. Columns are the eight",
|
||||
"questions: 1 content · 2 growth · 3 limit · 4 cleaner · 5 when full · 6 alarm · 7 repair or runbook · 8 how we know.",
|
||||
"", "| Place | Named | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | N |", "|---|---|---|---|---|---|---|---|---|---|---|"]
|
||||
tot = {m: 0 for m in "ADKN"}
|
||||
perq = {q: {m: 0 for m in "ADKN"} for q in range(1, 9)}
|
||||
named = {"NAMED": 0, "MENTIONED": 0, "UNNAMED": 0}
|
||||
members, krows = {c: [] for c in CLASS_ROW}, {}
|
||||
for p in places:
|
||||
named[p["named"]] += 1
|
||||
cells = []
|
||||
for q in range(1, 9):
|
||||
mk = p["marks"].get(q, "?")
|
||||
cells.append(f"**{mk}**" if mk == "N" else mk)
|
||||
if mk in tot:
|
||||
tot[mk] += 1
|
||||
perq[q][mk] += 1
|
||||
for q, c in p["n"].items():
|
||||
members.setdefault(c, []).append(f"{p['id']}-{q}")
|
||||
for q, rows in p["k"].items():
|
||||
for r in rows:
|
||||
krows.setdefault(r, []).append(f"{p['id']}-{q}")
|
||||
out.append(f"| {p['id']} {p['name']} | {p['named'].lower()} | " + " | ".join(cells) + f" | {len(p['n'])} |")
|
||||
n = len(places)
|
||||
out += ["", "## Totals", "",
|
||||
f"- Places: **{n}** customer places · named **{named['NAMED']}** · mentioned only **{named['MENTIONED']}** · "
|
||||
f"named by no architecture document **{named['UNNAMED']}**.",
|
||||
f"- Answers: **{n * 8}** · A **{tot['A']}** · D **{tot['D']}** · K **{tot['K']}** · N **{tot['N']}**.",
|
||||
f"- Places with no N: **{sum(1 for p in places if not p['n'])}** of {n}.",
|
||||
"", "| Question | A | D | K | N |", "|---|---|---|---|---|"]
|
||||
for q in range(1, 9):
|
||||
out.append(f"| {q} {QUESTIONS[q - 1]} | {perq[q]['A']} | {perq[q]['D']} | {perq[q]['K']} | {perq[q]['N']} |")
|
||||
out += ["", "## The N answers, by class row", "", "| Class | Row | Count | Members (place-question) |", "|---|---|---|---|"]
|
||||
for c in sorted(members):
|
||||
out.append(f"| {c} | {CLASS_ROW.get(c, '?')} | {len(members[c])} | {', '.join(members[c])} |")
|
||||
out += ["", "## The K answers, by existing row", "", "| Row | Count | Members |", "|---|---|---|"]
|
||||
for r in sorted(krows, key=lambda x: int(x[2:])):
|
||||
out.append(f"| {r} | {len(krows[r])} | {', '.join(krows[r])} |")
|
||||
return "\n".join(out) + "\n", tot, named, members
|
||||
|
||||
|
||||
def main() -> int:
|
||||
places, errors = parse(os.path.join(AUDIT, "TABLE.md"))
|
||||
for e in errors:
|
||||
print("BROKEN " + e)
|
||||
text, tot, named, members = build(places)
|
||||
if "--check" not in sys.argv[1:]:
|
||||
with open(os.path.join(AUDIT, "MATRIX.md"), "w", encoding="utf-8") as fh:
|
||||
fh.write(text)
|
||||
print(f"places {len(places)} named {named} marks {tot} "
|
||||
+ " ".join(f"{c}={len(m)}" for c, m in sorted(members.items())) + f" broken {len(errors)}")
|
||||
return 1 if errors else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Space list 2026-11-10 — which OS-level cleaners exist. READ-ONLY: findmnt, systemctl is-active/show, ls, cat of OS config (no secrets), stat.
|
||||
echo "### $(hostname) $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
echo "## /tmp fs"; findmnt -no FSTYPE,SIZE,USED /tmp 2>/dev/null || echo "/tmp is on /"
|
||||
echo "## tmpfiles rules for /tmp and /var/tmp"; systemd-tmpfiles --cat-config 2>/dev/null | grep -E "^[qQdD]\s+/(var/)?tmp\s"
|
||||
echo "## timers"; for t in systemd-tmpfiles-clean.timer logrotate.timer apt-daily.timer apt-daily-upgrade.timer fstrim.timer; do printf '%s enabled=%s active=%s last=%s\n' $t "$(systemctl is-enabled $t 2>/dev/null)" "$(systemctl is-active $t 2>/dev/null)" "$(systemctl show $t -p LastTriggerUSec --value 2>/dev/null)"; done
|
||||
echo "## logrotate.d"; ls /etc/logrotate.d 2>/dev/null | tr '\n' ' '; echo
|
||||
echo "## journald effective"; systemd-analyze cat-config systemd/journald.conf 2>/dev/null | grep -E "^\s*(Storage|SystemMaxUse|SystemKeepFree|RuntimeMaxUse|MaxRetentionSec|MaxFileSec)=" || echo "(all defaults)"
|
||||
echo "## apt periodic"; apt-config dump 2>/dev/null | grep -E "APT::Periodic|Unattended-Upgrade::Remove|Kernel-Packages|NeverAutoRemove" | cut -c1-160 | head -20
|
||||
echo "## pve task index"; if [ -d /var/log/pve/tasks ]; then wc -l /var/log/pve/tasks/index /var/log/pve/tasks/index.1 2>/dev/null; find /var/log/pve/tasks -type f -name 'UPID*' -printf '%TY-%Tm-%Td\n' | sort | sed -n '1p;$p'; fi
|
||||
echo "## lvm autoextend"; lvmconfig --type full activation/thin_pool_autoextend_threshold activation/thin_pool_autoextend_percent 2>/dev/null
|
||||
echo "## docker daemon.json keys (guest)"; [ -f /etc/docker/daemon.json ] && cat /etc/docker/daemon.json
|
||||
echo "## oldest files in /var/tmp and /tmp (dates only)"; find /tmp /var/tmp -xdev -mindepth 1 -maxdepth 1 -printf '%TY-%Tm-%Td %p\n' 2>/dev/null | sort | head -8
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
# The searches behind every N ("nobody asked") answer. Read-only: grep over the git clones on DooPlex.
|
||||
# Each search prints hit counts for: architecture folder, open register, closed register, runbooks, source.
|
||||
# Controls first: a word that MUST hit and a word that must NOT — a search that fails its control proves nothing.
|
||||
set -u
|
||||
W=/mnt/5_hdd/felhom.eu/git
|
||||
D=$W/felhom.eu/documentation
|
||||
SRC="$W/felhom-agent/internal $W/felhom-agent/configs $W/felhom-agent/cmd $W/felhom-controller/controller/internal $W/felhom-controller/controller/cmd $W/felhom.eu/hub/internal $W/felhom.eu/scripts"
|
||||
count() { # count <pattern>
|
||||
local p="$1"
|
||||
printf '%-58s arch=%-4s open=%-4s closed=%-4s runbooks=%-4s source=%s\n' "$p" \
|
||||
"$(grep -rliE -- "$p" $D/architecture 2>/dev/null | wc -l)" \
|
||||
"$(grep -ciE -- "$p" $D/backlog/OPEN-ITEMS.md)" \
|
||||
"$(grep -ciE -- "$p" $D/backlog/CLOSED-ITEMS.md)" \
|
||||
"$(grep -rliE -- "$p" $D/runbooks 2>/dev/null | wc -l)" \
|
||||
"$(grep -rliE --include='*.go' --include='*.sh' --include='felhom-*' -- "$p" $SRC 2>/dev/null | grep -v _test.go | wc -l)"
|
||||
}
|
||||
echo "# searches run $(date -u +%FT%TZ) — counts are FILES for arch/runbooks/source and LINES for the two registers"
|
||||
echo "## controls"
|
||||
count 'thin'
|
||||
count 'kernel'
|
||||
count 'megtel' # Hungarian ASCII fragment, positive control ("megtelt" = it is full)
|
||||
count 'zzqxnope' # negative control
|
||||
echo "## S1 old kernels: who removes them"
|
||||
count 'autoremove'
|
||||
count 'old kernel|kernel.*(remov|purge|prune)|(remov|purge|prune).*kernel'
|
||||
count '/lib/modules'
|
||||
echo "## S2 agent self-update staging folder: who prunes it"
|
||||
count 'selfupdate.*(prune|clean|remove old|keep)|(prune|clean).*selfupdate'
|
||||
count 'felhom-agent/selfupdate'
|
||||
echo "## S3 golden archive left in the dump folder"
|
||||
count 'remove-golden|golden.*(archive|tar\.zst).*(delete|remove|prune|keep)'
|
||||
count 'vzdump-lxc-9100'
|
||||
echo "## S4 host-disk alarm: who receives it"
|
||||
count 'host_disk_(warning|critical)'
|
||||
count 'storage_fill_(warning|critical)'
|
||||
count 'host_disk_'
|
||||
count 'storage_fill_'
|
||||
echo "## S5 a space budget for the host system disk"
|
||||
count 'space budget|disk budget|budget for (the )?(host|root|system)'
|
||||
echo "## S6 a written way out of a full disk"
|
||||
count 'disk[- ]full|No space left|ENOSPC'
|
||||
count 'megtelt|betelt|tele van'
|
||||
echo "## S7 helper images: a rule that deletes or refreshes them"
|
||||
count 'helper image'
|
||||
count 'hello-world'
|
||||
count '"alpine"'
|
||||
echo "## S8 off-site restore copy: an age or size limit"
|
||||
count 'offsite-restore'
|
||||
count 'offsite-restore.*(days|limit|age|sweep|prune)|(sweep|prune).*offsite-restore'
|
||||
echo "## S9 guest root filesystem: a watcher"
|
||||
count 'guest.{0,12}root ?(fs|filesystem).*(warn|alarm|watch)|rootfs.*(warn|alarm|fill)'
|
||||
echo "## S10 restic cache"
|
||||
count 'restic.{0,6}cache|RESTIC_CACHE_DIR|--cache-dir|--no-cache'
|
||||
echo "## S11 template cache"
|
||||
count 'template/cache|pveam'
|
||||
echo "## S12 container log cap re-check on a running box"
|
||||
count 'max-size|log-opts'
|
||||
echo "## S13 EFI partition: what happens when it fills, who watches it"
|
||||
count '/boot/efi' # how often the place is named at all (boot mechanics)
|
||||
count '(boot/efi|\besp\b|efi partition).{0,80}(full|fills|free space|no space|percent|megtel)'
|
||||
echo "## S14 the system log's storage and cap (host and guest)"
|
||||
count 'journald\.conf|SystemMaxUse|RuntimeMaxUse|Storage=(volatile|persistent|auto)'
|
||||
count 'guest.{0,40}journal.{0,60}(memory|volatile|/run|lost|persist)'
|
||||
echo "## S15 the log of a failed whole-box backup run"
|
||||
count 'vzdump.{0,60}\.log.{0,60}(remove|delete|prune|keep|stay)|failed.{0,30}vzdump.{0,30}log'
|
||||
Reference in new issue
Block a user