mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-22 14:47:30 +00:00
Add audit and reports page, and a change journal
ProxMenux modifies the host: it rewrites configuration files, installs packages, enables services. Until now nobody could say afterwards what had changed, and showing the script does not answer that question — a four-hundred-line function may alter two values, and the reader has no way to know which two. This adds the two halves of an answer. The change journal records what ProxMenux does as it does it. Eleven bash primitives capture the previous state, apply the change and record it in the same step, writing to a spool that the Monitor reads back. One hundred and thirteen functions across twenty-five scripts are instrumented, covering post-install, shared storage, security tooling, container conversions, disk operations and the PVE 8 to 9 upgrade path. The page shows the difference — rotate 7 becoming rotate 14 — and never the script. Restore and backup scripts are deliberately left out: a restore puts the host back to a state some other script already recorded. The Audit and reports page answers the other half: what state is this host in, regardless of who put it there. Forty-three checks across seven areas read the host and classify each result as critical, warning, observation, conformant, unverified or not applicable, with the evidence they read attached to each one. A declared policy lets the reader say what this particular host is expected to do — which guests must have a backup, which storages are essential — so the report judges the host against its own intent rather than a generic template. An inventory records the hardware, network and guest topology behind those readings, a comparison shows what moved between two runs, and six report profiles produce a printable document scoped to what the reader needs. Everything is available in the eight supported languages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6149,6 +6149,7 @@ class HealthMonitor:
|
||||
try:
|
||||
import flask_server # deferred — avoids circular import at module load
|
||||
resources = flask_server.get_cached_pvesh_cluster_resources_vm() or []
|
||||
local_node = flask_server.get_proxmox_node_name()
|
||||
except Exception as e:
|
||||
print(f"[HealthMonitor] LXC disk check failed: {e}")
|
||||
return None
|
||||
@@ -6170,6 +6171,12 @@ class HealthMonitor:
|
||||
for r in resources:
|
||||
if r.get('type') != 'lxc':
|
||||
continue
|
||||
# `/cluster/resources` is cluster-wide. Capacity belongs to the
|
||||
# node currently running the CT, so every Monitor must ignore
|
||||
# guests owned by another node or the same condition is recorded
|
||||
# and notified independently by every cluster member.
|
||||
if r.get('node') != local_node:
|
||||
continue
|
||||
if r.get('status') != 'running':
|
||||
# Stopped CTs — `disk` reads as 0 from pvesh because the
|
||||
# rootfs isn't mounted. Skip rather than report a
|
||||
@@ -6194,6 +6201,7 @@ class HealthMonitor:
|
||||
'maxdisk_bytes': maxdisk,
|
||||
'vmid': vmid,
|
||||
'name': name,
|
||||
'node': local_node,
|
||||
}
|
||||
error_key = f'lxc_disk_{vmid}'
|
||||
|
||||
@@ -6287,13 +6295,16 @@ class HealthMonitor:
|
||||
try:
|
||||
import flask_server # deferred — avoids circular import
|
||||
resources = flask_server.get_cached_pvesh_cluster_resources_vm() or []
|
||||
local_node = flask_server.get_proxmox_node_name()
|
||||
except Exception as e:
|
||||
print(f"[HealthMonitor] VM disk check failed: {e}")
|
||||
return None
|
||||
|
||||
# Cheap short-circuit: no running QEMU VMs on this node.
|
||||
if not any(
|
||||
r.get('type') in ('qemu', 'vm') and r.get('status') == 'running'
|
||||
r.get('type') in ('qemu', 'vm')
|
||||
and r.get('node') == local_node
|
||||
and r.get('status') == 'running'
|
||||
for r in resources
|
||||
):
|
||||
return None
|
||||
@@ -6308,6 +6319,8 @@ class HealthMonitor:
|
||||
for r in resources:
|
||||
if r.get('type') not in ('qemu', 'vm'):
|
||||
continue
|
||||
if r.get('node') != local_node:
|
||||
continue
|
||||
if r.get('status') != 'running':
|
||||
continue
|
||||
|
||||
@@ -6338,6 +6351,7 @@ class HealthMonitor:
|
||||
'maxdisk_bytes': total,
|
||||
'vmid': vmid_str,
|
||||
'name': name,
|
||||
'node': local_node,
|
||||
}
|
||||
error_key = f'vm_disk_{vmid_str}'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user