diff --git a/backend/src/routes/health.js b/backend/src/routes/health.js index b8ef2c5..9565d4c 100644 --- a/backend/src/routes/health.js +++ b/backend/src/routes/health.js @@ -10,7 +10,14 @@ healthRouter.get('/', async (_req, res) => { const missing = missingEnvVars(); const checks = { config: checkValue(!missing.length, missing.length ? `missing: ${missing.join(', ')}` : 'ok'), - commands: await checkCommands(['incus', 'zfs', 'zpool', 'restic', 'udevadm', 'dd']), + commands: await checkCommands({ + incus: ['version'], + zfs: ['version'], + zpool: ['version'], + restic: ['version'], + udevadm: ['--version'], + dd: ['--version'], + }), zfsPool: await checkZfsPool(), zvol: await checkZvolAccess(), resticRepository: await checkResticRepository(), @@ -22,8 +29,8 @@ healthRouter.get('/', async (_req, res) => { async function checkCommands(commands) { const results = {}; - await Promise.all(commands.map(async (command) => { - results[command] = await checkCommand(command, ['--version']); + await Promise.all(Object.entries(commands).map(async ([command, args]) => { + results[command] = await checkCommand(command, args); })); const failed = Object.entries(results).filter(([, result]) => !result.ok); return {