Added ZFS state metrics
This commit is contained in:
@@ -223,6 +223,40 @@ type PveDisk struct {
|
||||
Used string `json:"used,omitempty"` // How the drive is used (optional field).
|
||||
}
|
||||
|
||||
// PveZfsPool represents summary information about a ZFS pool.
|
||||
type PveZfsPool struct {
|
||||
Name string `json:"name"` // Pool name.
|
||||
Size uint64 `json:"size"` // Total pool size in bytes.
|
||||
Alloc uint64 `json:"alloc"` // Allocated pool space in bytes.
|
||||
Free uint64 `json:"free"` // Free pool space in bytes.
|
||||
Frag uint64 `json:"frag"` // Pool fragmentation percentage.
|
||||
Dedup float64 `json:"dedup"` // Pool deduplication ratio.
|
||||
Health string `json:"health"` // Pool health state.
|
||||
}
|
||||
|
||||
// PveZfsComponent represents a component in the recursive ZFS pool topology.
|
||||
// Error counters are pointers because section nodes such as "cache" do not
|
||||
// always contain read, write, or checksum values in the PVE API response.
|
||||
type PveZfsComponent struct {
|
||||
Name string `json:"name"` // Component, vdev, or device name.
|
||||
State string `json:"state"` // Component state, for example ONLINE.
|
||||
Leaf uint8 `json:"leaf"` // Whether this component is a leaf device.
|
||||
Read *uint64 `json:"read"` // Read error count when available.
|
||||
Write *uint64 `json:"write"` // Write error count when available.
|
||||
Checksum *uint64 `json:"cksum"` // Checksum error count when available.
|
||||
Message string `json:"msg"` // Optional component status message.
|
||||
Children []PveZfsComponent `json:"children"` // Nested ZFS components.
|
||||
}
|
||||
|
||||
// PveZfsPoolStatus represents the detailed status and topology of a ZFS pool.
|
||||
type PveZfsPoolStatus struct {
|
||||
PveZfsComponent
|
||||
Status string `json:"status"` // Human-readable pool status.
|
||||
Action string `json:"action"` // Recommended recovery action.
|
||||
Scan string `json:"scan"` // Last or current scrub information.
|
||||
Errors string `json:"errors"` // Human-readable pool errors.
|
||||
}
|
||||
|
||||
// PVE node time.
|
||||
type PveNodeTime struct {
|
||||
Time uint64 `json:"time"` // Unix timestamp in UTC.
|
||||
|
||||
Reference in New Issue
Block a user