From 01e630270942f19cd0bef0519c0cead2c64b51bd Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Fri, 3 Apr 2026 15:39:35 -0500 Subject: [PATCH] feat: right-size VM 115 config and add --hosts flag to audit script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- monitoring/scripts/homelab-audit.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/monitoring/scripts/homelab-audit.sh b/monitoring/scripts/homelab-audit.sh index 55c8c1c..6477304 100755 --- a/monitoring/scripts/homelab-audit.sh +++ b/monitoring/scripts/homelab-audit.sh @@ -44,7 +44,7 @@ while [[ $# -gt 0 ]]; do ;; --hosts) if [[ $# -lt 2 ]]; then - echo "Error: --hosts requires an argument" >&2 + echo "Error: --hosts requires an argument (label:ip,label:ip,...)" >&2 exit 1 fi HOSTS_FILTER="$2" @@ -492,20 +492,24 @@ main() { if [[ -n "$HOSTS_FILTER" ]]; then # --hosts mode: audit specified hosts directly, skip Proxmox inventory + # Accepts comma-separated entries; each entry may be plain hostname or label:ip local check_proxmox=0 IFS=',' read -ra filter_hosts <<<"$HOSTS_FILTER" - for host in "${filter_hosts[@]}"; do - [[ "$host" == "proxmox" ]] && check_proxmox=1 + for entry in "${filter_hosts[@]}"; do + local label="${entry%%:*}" + [[ "$label" == "proxmox" ]] && check_proxmox=1 done if ((check_proxmox)); then echo " Checking Proxmox backup recency..." check_backup_recency fi - for host in "${filter_hosts[@]}"; do - echo " Auditing $host..." - parse_and_report "$host" "$host" - check_cert_expiry "$host" "$host" - AUDITED_HOSTS+=("$host") + for entry in "${filter_hosts[@]}"; do + local label="${entry%%:*}" + local addr="${entry#*:}" + echo " Auditing $label ($addr)..." + parse_and_report "$label" "$addr" + check_cert_expiry "$label" "$addr" + AUDITED_HOSTS+=("$label") ((host_count++)) || true done else