Added ZFS state metrics
Build Docker image on push / docker (push) Successful in 23s
Build and push Docker image on tag / docker (push) Successful in 23s

This commit is contained in:
2026-08-17 22:08:57 +02:00
parent f8f9e0c852
commit ba88e5997a
9 changed files with 363 additions and 3 deletions
+32
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net/url"
"time"
"github.com/mitchellh/mapstructure"
@@ -212,6 +213,37 @@ func (instance *PveApiClient) GetNodeDisksList(node string) (*[]PveDisk, error)
return &disks, nil
}
// Get ZFS pools configured on a PVE node.
func (instance *PveApiClient) GetNodeZfsPools(node string) (*[]PveZfsPool, error) {
res, err := instance.apiClient.PerformRequest("GET", "/nodes/"+node+"/disks/zfs", nil)
if err != nil {
return nil, err
}
var pools []PveZfsPool
if err := json.Unmarshal(res.Data, &pools); err != nil {
return nil, err
}
return &pools, nil
}
// Get detailed status and topology of a ZFS pool on a PVE node.
func (instance *PveApiClient) GetNodeZfsPoolStatus(node string, pool string) (*PveZfsPoolStatus, error) {
path := "/nodes/" + node + "/disks/zfs/" + url.PathEscape(pool)
res, err := instance.apiClient.PerformRequest("GET", path, nil)
if err != nil {
return nil, err
}
var status PveZfsPoolStatus
if err := json.Unmarshal(res.Data, &status); err != nil {
return nil, err
}
return &status, nil
}
// Get PVE node time info.
func (instance *PveApiClient) GetNodeTime(node string) (*PveNodeTime, error) {
res, err := instance.apiClient.PerformRequest("GET", "/nodes/"+node+"/time", nil)