fix: keep PBS logs and maintenance jobs readable

- Draw ZFS ARC only from recorded history, leaving it out on PBS
- Read the maintenance jobs of a local PBS from its API, with their last state
- Show the OK state of PBS jobs in green whatever its case
- Compress rotated logs at once in the Log2RAM and logrotate profiles
- Offer the Log2RAM 1.8 and logrotate 1.2 update to existing installations
This commit is contained in:
MacRimi
2026-10-20 00:53:21 +02:00
parent d8741a8c5d
commit 0a7a598210
7 changed files with 43 additions and 30 deletions
+2 -14
View File
@@ -12242,18 +12242,6 @@ def _compute_node_metrics_payload(timeframe: str) -> dict:
deadline = time.monotonic() + _NODE_METRICS_TIMEOUT
local_node = get_proxmox_node_name()
zfs_arc_size = 0
try:
with open('/proc/spl/kstat/zfs/arcstats', 'r') as f:
for line in f:
if line.startswith('size'):
parts = line.split()
if len(parts) >= 3:
zfs_arc_size = int(parts[2])
break
except (FileNotFoundError, PermissionError, ValueError):
pass
try:
rrd_result = subprocess.run(
_node_rrd_command(local_node, timeframe),
@@ -12322,11 +12310,11 @@ def _compute_node_metrics_payload(timeframe: str) -> dict:
'code': 'metrics_invalid_data',
})
# Only the history the node recorded is drawn. A PBS RRD has no ARC field,
# and the current size repeated over the period is not its history.
for item in rrd_data:
if 'arcsize' in item:
item['zfsarc'] = item['arcsize']
elif zfs_arc_size > 0 and ('zfsarc' not in item or item.get('zfsarc', 0) == 0):
item['zfsarc'] = zfs_arc_size
def _values_from(items, field_key, scale=1.0):
return [item[field_key] * scale for item in items