Add more info to diagnostics endpoint

This commit is contained in:
D. Berge
2024-05-09 14:02:18 +02:00
parent af0df23cc4
commit d154e75797

View File

@@ -1,3 +1,4 @@
const os = require('os');
const { statfs } = require('fs').promises;
const { pool } = require('./db/connection');
const cfg = require('./config');
@@ -75,6 +76,15 @@ async function diagnostics () {
data[path] = await df(paths[path]);
}
const res = {
hostname: os.hostname(),
memory: {
total: os.totalmem(),
free: os.freemem()
},
uptime: os.uptime(),
loadavg: os.loadavg(),
networkInterfaces: os.networkInterfaces(),
cpus: os.cpus(),
storage: {
root: await df("/"),
data