Updates
CI / test (push) Successful in 1m4s
Release rolling / release (push) Successful in 7m14s

This commit is contained in:
Raven Scott
2026-07-18 20:01:47 -04:00
parent a639b3c953
commit 52a1823469
7 changed files with 187 additions and 32 deletions
+8 -7
View File
@@ -4,7 +4,7 @@
*/
import fs from 'fs'
import path from 'path'
import { spawnSync } from 'child_process'
import { execFileSync } from '../../utils/exec.js'
import { CollectorPlugin } from './plugin.js'
import { registerChart } from '../../../shared/metrics.js'
@@ -106,12 +106,13 @@ export class ZfsCollector extends CollectorPlugin {
// zpool list -Hp
try {
const res = spawnSync('zpool', ['list', '-Hp', '-o', 'name,size,alloc,free,health'], {
encoding: 'utf8',
timeout: 2000,
})
if (res.status === 0 && res.stdout) {
for (const line of res.stdout.trim().split('\n')) {
const { stdout } = execFileSync(
'zpool',
['list', '-Hp', '-o', 'name,size,alloc,free,health'],
{ encoding: 'utf8' }
)
if (stdout) {
for (const line of String(stdout).trim().split('\n')) {
const [name, size, alloc, free, health] = line.split('\t')
if (!name) continue
const id = `zfs.pool.${name.replace(/[^\w.-]/g, '_')}`