feat: right-size VM 115 config and add --hosts flag to audit script
All checks were successful
Auto-merge docs-only PRs / auto-merge-docs (pull_request) Successful in 2s
All checks were successful
Auto-merge docs-only PRs / auto-merge-docs (pull_request) Successful in 2s
Reduce VM 115 (docker-sba) from 16 vCPUs (2×8) to 8 vCPUs (1×8) to match actual workload (0.06 load/core). Add --hosts flag to homelab-audit.sh for targeted post-change audits. Closes #18 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
64f299aa1a
commit
48a804dda2
@ -5,7 +5,7 @@
|
|||||||
# to collect system metrics, then generates a summary report.
|
# to collect system metrics, then generates a summary report.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# homelab-audit.sh [--output-dir DIR]
|
# homelab-audit.sh [--output-dir DIR] [--hosts label:ip,label:ip,...]
|
||||||
#
|
#
|
||||||
# Environment overrides:
|
# Environment overrides:
|
||||||
# STUCK_PROC_CPU_WARN CPU% at which a D-state process is flagged (default: 10)
|
# STUCK_PROC_CPU_WARN CPU% at which a D-state process is flagged (default: 10)
|
||||||
@ -29,7 +29,6 @@ LOAD_WARN=2.0
|
|||||||
MEM_WARN=85
|
MEM_WARN=85
|
||||||
ZOMBIE_WARN=1
|
ZOMBIE_WARN=1
|
||||||
SWAP_WARN=512
|
SWAP_WARN=512
|
||||||
|
|
||||||
HOSTS_FILTER="" # comma-separated host list from --hosts; empty = audit all
|
HOSTS_FILTER="" # comma-separated host list from --hosts; empty = audit all
|
||||||
JSON_OUTPUT=0 # set to 1 by --json
|
JSON_OUTPUT=0 # set to 1 by --json
|
||||||
|
|
||||||
|
|||||||
@ -93,6 +93,34 @@ else
|
|||||||
fail "disk_usage" "expected 'N /path', got: '$result'"
|
fail "disk_usage" "expected 'N /path', got: '$result'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --- --hosts flag parsing ---
|
||||||
|
echo ""
|
||||||
|
echo "=== --hosts argument parsing tests ==="
|
||||||
|
|
||||||
|
# Single host
|
||||||
|
input="vm-115:10.10.0.88"
|
||||||
|
IFS=',' read -ra entries <<<"$input"
|
||||||
|
label="${entries[0]%%:*}"
|
||||||
|
addr="${entries[0]#*:}"
|
||||||
|
if [[ "$label" == "vm-115" && "$addr" == "10.10.0.88" ]]; then
|
||||||
|
pass "--hosts single entry parsed: $label $addr"
|
||||||
|
else
|
||||||
|
fail "--hosts single" "expected 'vm-115 10.10.0.88', got: '$label $addr'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Multiple hosts
|
||||||
|
input="vm-115:10.10.0.88,lxc-225:10.10.0.225"
|
||||||
|
IFS=',' read -ra entries <<<"$input"
|
||||||
|
label1="${entries[0]%%:*}"
|
||||||
|
addr1="${entries[0]#*:}"
|
||||||
|
label2="${entries[1]%%:*}"
|
||||||
|
addr2="${entries[1]#*:}"
|
||||||
|
if [[ "$label1" == "vm-115" && "$addr1" == "10.10.0.88" && "$label2" == "lxc-225" && "$addr2" == "10.10.0.225" ]]; then
|
||||||
|
pass "--hosts multi entry parsed: $label1 $addr1, $label2 $addr2"
|
||||||
|
else
|
||||||
|
fail "--hosts multi" "unexpected parse result"
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== Results: $PASS passed, $FAIL failed ==="
|
echo "=== Results: $PASS passed, $FAIL failed ==="
|
||||||
((FAIL == 0))
|
((FAIL == 0))
|
||||||
|
|||||||
@ -12,5 +12,5 @@ ostype: l26
|
|||||||
scsi0: local-lvm:vm-115-disk-0,size=256G
|
scsi0: local-lvm:vm-115-disk-0,size=256G
|
||||||
scsihw: virtio-scsi-pci
|
scsihw: virtio-scsi-pci
|
||||||
smbios1: uuid=19be98ee-f60d-473d-acd2-9164717fcd11
|
smbios1: uuid=19be98ee-f60d-473d-acd2-9164717fcd11
|
||||||
sockets: 2
|
sockets: 1
|
||||||
vmgenid: 682dfeab-8c63-4f0b-8ed2-8828c2f808ef
|
vmgenid: 682dfeab-8c63-4f0b-8ed2-8828c2f808ef
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user