summaryrefslogtreecommitdiffstats
path: root/src/go/plugin/go.d/modules/zfspool/collect.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/plugin/go.d/modules/zfspool/collect.go')
-rw-r--r--src/go/plugin/go.d/modules/zfspool/collect.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/go/plugin/go.d/modules/zfspool/collect.go b/src/go/plugin/go.d/modules/zfspool/collect.go
new file mode 100644
index 000000000..b9b29058b
--- /dev/null
+++ b/src/go/plugin/go.d/modules/zfspool/collect.go
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package zfspool
+
+var zpoolHealthStates = []string{
+ "online",
+ "degraded",
+ "faulted",
+ "offline",
+ "removed",
+ "unavail",
+ "suspended",
+}
+
+func (z *ZFSPool) collect() (map[string]int64, error) {
+
+ mx := make(map[string]int64)
+
+ if err := z.collectZpoolList(mx); err != nil {
+ return nil, err
+ }
+ if err := z.collectZpoolListVdev(mx); err != nil {
+ return mx, err
+ }
+
+ return mx, nil
+}