diff --git a/CHANGELOG.md b/CHANGELOG.md index facab2d..f93bac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.6.22 | 2021-05-18 | `diskLayout()` fixed to small buffer smartdata (linux) | | 5.6.21 | 2021-05-14 | `graphics()` fixed dual gpu issue (macOS) | | 5.6.20 | 2021-05-07 | `system()` fixed vm detection (linux) | | 5.6.19 | 2021-05-06 | `services()` modified service listing (linux) | diff --git a/docs/history.html b/docs/history.html index e7cec98..9f0562f 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,6 +56,11 @@ + + 5.6.22 + 2021-05-18 + diskLayout() fixed to small buffer smartdata (linux) + 5.6.21 2021-05-14 diff --git a/docs/index.html b/docs/index.html index c32439d..4603855 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.6.21
+
New Version: 5.6.22
diff --git a/lib/filesystem.js b/lib/filesystem.js index 0b2ea84..9f1a029 100755 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -96,7 +96,7 @@ function fsSize(callback) { } if (_linux) { cmd = 'df -lkPTx squashfs | grep -E "^/|^.\\:"'; } if (_freebsd || _openbsd || _netbsd) { cmd = 'df -lkPT'; } - exec(cmd, function (error, stdout) { + exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); data = parseDf(lines); @@ -105,7 +105,7 @@ function fsSize(callback) { } resolve(data); } else { - exec('df -kPT', function (error, stdout) { + exec('df -kPT', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); data = parseDf(lines); @@ -172,7 +172,7 @@ function fsOpenFiles(callback) { }; if (_freebsd || _openbsd || _netbsd || _darwin) { let cmd = 'sysctl -a | grep \'kern.*files\''; - exec(cmd, function (error, stdout) { + exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); result.max = parseInt(util.getValue(lines, 'kern.maxfiles', ':'), 10); @@ -351,7 +351,7 @@ function blockDevices(callback) { if (_linux) { // see https://wiki.ubuntuusers.de/lsblk/ // exec("lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,TRAN,SERIAL,LABEL,MODEL,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,SCHED,RQ-SIZE,RA,WSAME", function (error, stdout) { - exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null', function (error, stdout) { + exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = blkStdoutToObject(stdout).split('\n'); data = parseBlk(lines); @@ -360,7 +360,7 @@ function blockDevices(callback) { } resolve(data); } else { - exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null', function (error, stdout) { + exec('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = blkStdoutToObject(stdout).split('\n'); data = parseBlk(lines); @@ -374,7 +374,7 @@ function blockDevices(callback) { }); } if (_darwin) { - exec('diskutil info -all', function (error, stdout) { + exec('diskutil info -all', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); // parse lines into temp array of devices @@ -509,7 +509,7 @@ function fsStats(callback) { if ((_fs_speed && !_fs_speed.ms) || (_fs_speed && _fs_speed.ms && Date.now() - _fs_speed.ms >= 500)) { if (_linux) { // exec("df -k | grep /dev/", function(error, stdout) { - exec('lsblk -r 2>/dev/null | grep /', function (error, stdout) { + exec('lsblk -r 2>/dev/null | grep /', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); let fs_filter = []; @@ -521,7 +521,7 @@ function fsStats(callback) { }); let output = fs_filter.join('|'); - exec('cat /proc/diskstats | egrep "' + output + '"', function (error, stdout) { + exec('cat /proc/diskstats | egrep "' + output + '"', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); lines.forEach(function (line) { @@ -549,7 +549,7 @@ function fsStats(callback) { }); } if (_darwin) { - exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', function (error, stdout) { + exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); lines.forEach(function (line) { @@ -658,7 +658,7 @@ function disksIO(callback) { // var cmd = "for mount in `lsblk | grep / | sed 's/[│└─├]//g' | awk '{$1=$1};1' | cut -d ' ' -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r 's/ +/;/g' | sed -r 's/^;//'; done"; let cmd = 'for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[│└─├]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done'; - exec(cmd, function (error, stdout) { + exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.split('\n'); lines.forEach(function (line) { @@ -685,7 +685,7 @@ function disksIO(callback) { }); } if (_darwin) { - exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', function (error, stdout) { + exec('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); lines.forEach(function (line) { @@ -791,7 +791,7 @@ function diskLayout(callback) { if (_linux) { let cmdFullSmart = ''; - exec('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL', function (error, stdout) { + exec('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { try { const out = stdout.toString().trim(); @@ -851,7 +851,7 @@ function diskLayout(callback) { } // check S.M.A.R.T. status if (cmdFullSmart) { - exec(cmdFullSmart, function (error, stdout) { + exec(cmdFullSmart, { maxBuffer: 1024 * 1024 }, function (error, stdout) { try { const data = JSON.parse(`[${stdout}]`); data.forEach(disk => { @@ -871,7 +871,7 @@ function diskLayout(callback) { } catch (e) { if (cmd) { cmd = cmd + 'printf "\n"'; - exec(cmd, function (error, stdout) { + exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) { let lines = stdout.toString().split('\n'); lines.forEach(line => { if (line) { @@ -913,7 +913,7 @@ function diskLayout(callback) { resolve(result); } if (_darwin) { - exec('system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType', function (error, stdout) { + exec('system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType', { maxBuffer: 1024 * 1024 }, function (error, stdout) { if (!error) { // split by type: let lines = stdout.toString().split('\n'); @@ -1071,7 +1071,7 @@ function diskLayout(callback) { } if (cmd) { cmd = cmd + 'printf "\n"'; - exec(cmd, function (error, stdout) { + exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) { let lines = stdout.toString().split('\n'); lines.forEach(line => { if (line) {