feat(agent): enrich zpool summary with type, scan state, vdev list

This commit is contained in:
Carsten 2026-04-22 17:44:07 +02:00
parent a4f4d3ca51
commit e763ea96bd
3 changed files with 61 additions and 5 deletions

View file

@ -26,7 +26,7 @@
"state": "DEGRADED",
"scan": {
"function": "scrub",
"state": "FINISHED",
"state": "SCANNING",
"end_time": "Tue Mar 01 08:00:00 2026"
},
"error_count": "2",

View file

@ -32,10 +32,19 @@ defmodule ProxmoxAgent.Collectors.ZfsTest do
assert rpool.size_bytes == 500_000_000_000
assert rpool.error_count == 0
assert rpool.degraded_vdev_count == 0
assert rpool.pool_type == "mirror"
assert rpool.scan_function == "scrub"
assert rpool.scan_state == "FINISHED"
assert [%{name: "mirror-0", type: "mirror", state: "ONLINE",
read_errors: 0, write_errors: 0, checksum_errors: 0}] = rpool.vdevs
assert tank.health == "DEGRADED"
assert tank.error_count == 2
assert tank.degraded_vdev_count == 1
assert tank.pool_type == "raidz2"
assert tank.scan_state == "SCANNING"
assert [%{name: "raidz2-0", type: "raidz2", state: "DEGRADED",
checksum_errors: 2}] = tank.vdevs
end
test "populates errors list when zpool fails" do