diskLayout() fixed to small buffer smartdata (linux)
This commit is contained in:
parent
49f9bebbc4
commit
4c96cf2f03
@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| 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.21 | 2021-05-14 | `graphics()` fixed dual gpu issue (macOS) |
|
||||||
| 5.6.20 | 2021-05-07 | `system()` fixed vm detection (linux) |
|
| 5.6.20 | 2021-05-07 | `system()` fixed vm detection (linux) |
|
||||||
| 5.6.19 | 2021-05-06 | `services()` modified service listing (linux) |
|
| 5.6.19 | 2021-05-06 | `services()` modified service listing (linux) |
|
||||||
|
|||||||
@ -56,6 +56,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.6.22</th>
|
||||||
|
<td>2021-05-18</td>
|
||||||
|
<td><span class="code">diskLayout()</span> fixed to small buffer smartdata (linux)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.6.21</th>
|
<th scope="row">5.6.21</th>
|
||||||
<td>2021-05-14</td>
|
<td>2021-05-14</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span> </div>
|
<div class="subtitle"><span id="typed"></span> </div>
|
||||||
<div class="version">New Version: <span id="version">5.6.21</span></div>
|
<div class="version">New Version: <span id="version">5.6.22</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
|
|||||||
@ -96,7 +96,7 @@ function fsSize(callback) {
|
|||||||
}
|
}
|
||||||
if (_linux) { cmd = 'df -lkPTx squashfs | grep -E "^/|^.\\:"'; }
|
if (_linux) { cmd = 'df -lkPTx squashfs | grep -E "^/|^.\\:"'; }
|
||||||
if (_freebsd || _openbsd || _netbsd) { cmd = 'df -lkPT'; }
|
if (_freebsd || _openbsd || _netbsd) { cmd = 'df -lkPT'; }
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
data = parseDf(lines);
|
data = parseDf(lines);
|
||||||
@ -105,7 +105,7 @@ function fsSize(callback) {
|
|||||||
}
|
}
|
||||||
resolve(data);
|
resolve(data);
|
||||||
} else {
|
} else {
|
||||||
exec('df -kPT', function (error, stdout) {
|
exec('df -kPT', { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
data = parseDf(lines);
|
data = parseDf(lines);
|
||||||
@ -172,7 +172,7 @@ function fsOpenFiles(callback) {
|
|||||||
};
|
};
|
||||||
if (_freebsd || _openbsd || _netbsd || _darwin) {
|
if (_freebsd || _openbsd || _netbsd || _darwin) {
|
||||||
let cmd = 'sysctl -a | grep \'kern.*files\'';
|
let cmd = 'sysctl -a | grep \'kern.*files\'';
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
result.max = parseInt(util.getValue(lines, 'kern.maxfiles', ':'), 10);
|
result.max = parseInt(util.getValue(lines, 'kern.maxfiles', ':'), 10);
|
||||||
@ -351,7 +351,7 @@ function blockDevices(callback) {
|
|||||||
if (_linux) {
|
if (_linux) {
|
||||||
// see https://wiki.ubuntuusers.de/lsblk/
|
// 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 -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) {
|
if (!error) {
|
||||||
let lines = blkStdoutToObject(stdout).split('\n');
|
let lines = blkStdoutToObject(stdout).split('\n');
|
||||||
data = parseBlk(lines);
|
data = parseBlk(lines);
|
||||||
@ -360,7 +360,7 @@ function blockDevices(callback) {
|
|||||||
}
|
}
|
||||||
resolve(data);
|
resolve(data);
|
||||||
} else {
|
} 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) {
|
if (!error) {
|
||||||
let lines = blkStdoutToObject(stdout).split('\n');
|
let lines = blkStdoutToObject(stdout).split('\n');
|
||||||
data = parseBlk(lines);
|
data = parseBlk(lines);
|
||||||
@ -374,7 +374,7 @@ function blockDevices(callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
exec('diskutil info -all', function (error, stdout) {
|
exec('diskutil info -all', { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
// parse lines into temp array of devices
|
// 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 ((_fs_speed && !_fs_speed.ms) || (_fs_speed && _fs_speed.ms && Date.now() - _fs_speed.ms >= 500)) {
|
||||||
if (_linux) {
|
if (_linux) {
|
||||||
// exec("df -k | grep /dev/", function(error, stdout) {
|
// 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) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
let fs_filter = [];
|
let fs_filter = [];
|
||||||
@ -521,7 +521,7 @@ function fsStats(callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let output = fs_filter.join('|');
|
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) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
@ -549,7 +549,7 @@ function fsStats(callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_darwin) {
|
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) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
lines.forEach(function (line) {
|
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";
|
// 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';
|
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) {
|
if (!error) {
|
||||||
let lines = stdout.split('\n');
|
let lines = stdout.split('\n');
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
@ -685,7 +685,7 @@ function disksIO(callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_darwin) {
|
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) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
@ -791,7 +791,7 @@ function diskLayout(callback) {
|
|||||||
if (_linux) {
|
if (_linux) {
|
||||||
let cmdFullSmart = '';
|
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) {
|
if (!error) {
|
||||||
try {
|
try {
|
||||||
const out = stdout.toString().trim();
|
const out = stdout.toString().trim();
|
||||||
@ -851,7 +851,7 @@ function diskLayout(callback) {
|
|||||||
}
|
}
|
||||||
// check S.M.A.R.T. status
|
// check S.M.A.R.T. status
|
||||||
if (cmdFullSmart) {
|
if (cmdFullSmart) {
|
||||||
exec(cmdFullSmart, function (error, stdout) {
|
exec(cmdFullSmart, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(`[${stdout}]`);
|
const data = JSON.parse(`[${stdout}]`);
|
||||||
data.forEach(disk => {
|
data.forEach(disk => {
|
||||||
@ -871,7 +871,7 @@ function diskLayout(callback) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
cmd = cmd + 'printf "\n"';
|
cmd = cmd + 'printf "\n"';
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
lines.forEach(line => {
|
lines.forEach(line => {
|
||||||
if (line) {
|
if (line) {
|
||||||
@ -913,7 +913,7 @@ function diskLayout(callback) {
|
|||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
if (_darwin) {
|
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) {
|
if (!error) {
|
||||||
// split by type:
|
// split by type:
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
@ -1071,7 +1071,7 @@ function diskLayout(callback) {
|
|||||||
}
|
}
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
cmd = cmd + 'printf "\n"';
|
cmd = cmd + 'printf "\n"';
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 1024 }, function (error, stdout) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
lines.forEach(line => {
|
lines.forEach(line => {
|
||||||
if (line) {
|
if (line) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user