system() improved virtual host detection for Parallels

This commit is contained in:
Sebastian Hildebrandt 2023-01-30 08:33:23 +01:00
parent 9c617abcba
commit f14db77206
6 changed files with 46 additions and 145 deletions

View File

@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.17.8 | 2023-01-30 | `system()` improved virtual host detection for Parallels |
| 5.17.7 | 2023-01-29 | `processes()` fixed CPU usage info (windows) |
| 5.17.6 | 2023-01-29 | `processes()` fixed Node Version 8 compatibility issue |
| 5.17.5 | 2023-01-29 | `processes()` improved parsing of all services (linux) |

View File

@ -1023,7 +1023,7 @@ Solaris, OpenSolaris and registered trademarks of Sun Microsystems, VMware is a
Virtual Box is a trademark of Oracle Corporation, Xen is a registered trademark of Xen Project,
QEMU is a trademark of Fabrice Bellard, bochs is a trademark of The Bochs Project, USB and USB Logo
are trademarks of USB Implementation Forum, Bluetooth and Bluetooth Logo are trademarks of Bluetooth SIG,
Android is a trademark of Google LLC.
Android is a trademark of Google LLC, Parallels is a trademarks of Parallels International GmbH.
All other trademarks are the property of their respective owners.

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.17.8</th>
<td>2023-01-30</td>
<td><span class="code">system()</span> improved virtual host detection for Parallels</td>
</tr>
<tr>
<th scope="row">5.17.7</th>
<td>2023-01-29</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.17.7</span></div>
<div class="version">New Version: <span id="version">5.17.8</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>
</div>
<div class="down">

View File

@ -46,36 +46,37 @@
<div class="text">
<p>The following trademarks are the properties of their respective owners as listed below. Should any trademark attribution be missing, mistaken or erroneous, please contact us as soon as possible for rectification.</p>
<ul>
<li><strong>Node.js</strong> is a trademark of Joyent Inc.</li>
<li><strong>Linux</strong> is a registered trademark of Linus Torvalds</li>
<li><strong>Apple, macOS, OS X, CUPS</strong> are registered trademarks of Apple Inc.</li>
<li><strong>Windows</strong> is a registered trademark of Microsoft Corporation</li>
<li><strong>Intel</strong> is a trademark of Intel Corporation</li>
<li><strong>AMD</strong> is a trademark of Advanced Micro Devices Inc.</li>
<li><strong>Ryzen</strong> is a trademark of Advanced Micro Devices Inc.</li>
<li><strong>Raspberry Pi</strong> is a trademark of the Raspberry Pi Foundation</li>
<li><strong>Debian</strong> is a trademark owned by Software in the Public Interest, Inc.</li>
<li><strong>FreeBSD</strong> is a registered trademark of The FreeBSD Foundation</li>
<li><strong>NetBSD</strong> is a registered trademark of The NetBSD Foundation</li>
<li><strong>Docker</strong> is a trademark of Docker, Inc.</li>
<li><strong>Ubuntu</strong> is a trademark of Canonical Ltd.</li>
<li><strong>CentOS</strong> is a trademark of Read Hat Inc.</li>
<li><strong>Sun, Solaris, OpenSolaris</strong> are registered trademarks of Sun Microsystems</li>
<li><strong>Virtual Box</strong> is a registered trademark of Oracle Corporation</li>
<li><strong>Xen</strong> is a registered trademark of Xen Project, The Linux Foundation Projects</li>
<li><strong>VMware</strong> is a registered trademark of VMware, Inc.</li>
<li><strong>bochs</strong> is a trademark of The Bochs Project</li>
<li><strong>QEMU</strong> is a trademark of Fabrice Bellard.</li>
<li><strong>BSD</strong> is a registered trademark of UUnet Technologies, Inc.</li>
<li><strong>UNIX</strong> is a registered trademark of The Open Group.</li>
<li><strong>NVIDIA</strong> is a registered trademark of NVIDIA Corporation.</li>
<li><strong>MSI</strong> is a registered trademark Micro-Star International Co.</li>
<li><strong>DELL</strong> is a registered trademark of Dell Inc.</li>
<li><strong>ASUS</strong> is a registered trademark of ASUSTeK Computer.</li>
<li><strong>Alpine</strong> is a trademark of Alpine Linux Development Team.</li>
<li><strong>USB and USB Logo</strong> are trademarks of USB Implementation Forum.</li>
<li><strong>Bluetooth and Bluetooth Logo</strong> are trademarks of Bluetooth SIG..</li>
<li><strong>AMD</strong> is a trademark of Advanced Micro Devices Inc.</li>
<li><strong>Android</strong> is a trademark of Google LLC.</li>
<li><strong>Apple, macOS, OS X, CUPS</strong> are registered trademarks of Apple Inc.</li>
<li><strong>ASUS</strong> is a registered trademark of ASUSTeK Computer.</li>
<li><strong>Bluetooth and Bluetooth Logo</strong> are trademarks of Bluetooth SIG..</li>
<li><strong>bochs</strong> is a trademark of The Bochs Project</li>
<li><strong>BSD</strong> is a registered trademark of UUnet Technologies, Inc.</li>
<li><strong>CentOS</strong> is a trademark of Read Hat Inc.</li>
<li><strong>Debian</strong> is a trademark owned by Software in the Public Interest, Inc.</li>
<li><strong>DELL</strong> is a registered trademark of Dell Inc.</li>
<li><strong>Docker</strong> is a trademark of Docker, Inc.</li>
<li><strong>FreeBSD</strong> is a registered trademark of The FreeBSD Foundation</li>
<li><strong>Intel</strong> is a trademark of Intel Corporation</li>
<li><strong>Linux</strong> is a registered trademark of Linus Torvalds</li>
<li><strong>MSI</strong> is a registered trademark Micro-Star International Co.</li>
<li><strong>NetBSD</strong> is a registered trademark of The NetBSD Foundation</li>
<li><strong>Node.js</strong> is a trademark of Joyent Inc.</li>
<li><strong>NVIDIA</strong> is a registered trademark of NVIDIA Corporation.</li>
<li><strong>Parallels</strong> is a trademarks of Parallels International GmbH.</li>
<li><strong>QEMU</strong> is a trademark of Fabrice Bellard.</li>
<li><strong>Raspberry Pi</strong> is a trademark of the Raspberry Pi Foundation</li>
<li><strong>Ryzen</strong> is a trademark of Advanced Micro Devices Inc.</li>
<li><strong>Sun, Solaris, OpenSolaris</strong> are registered trademarks of Sun Microsystems</li>
<li><strong>Ubuntu</strong> is a trademark of Canonical Ltd.</li>
<li><strong>UNIX</strong> is a registered trademark of The Open Group.</li>
<li><strong>USB and USB Logo</strong> are trademarks of USB Implementation Forum.</li>
<li><strong>Virtual Box</strong> is a registered trademark of Oracle Corporation</li>
<li><strong>VMware</strong> is a registered trademark of VMware, Inc.</li>
<li><strong>Windows</strong> is a registered trademark of Microsoft Corporation</li>
<li><strong>Xen</strong> is a registered trademark of Xen Project, The Linux Foundation Projects</li>
<li><strong>+innovations</strong> is a trademark of plus-innovations application development GmbH</li>
</ul>
<p>All other trademarks are the property of their respective owners.</p>
@ -131,4 +132,4 @@
</script>
</body>
</html>
</html>

View File

@ -201,115 +201,6 @@ function system(callback) {
revision: rPIRevision.revision
};
}
// if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') {
// // Pi 4
// if (['d03114'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 4 Model B';
// result.version = result.version + ' - Rev. 1.4';
// }
// if (['b03112', 'c03112'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 4 Model B';
// result.version = result.version + ' - Rev. 1.2';
// }
// if (['a03111', 'b03111', 'c03111'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 4 Model B';
// result.version = result.version + ' - Rev. 1.1';
// }
// // Pi 3
// if (['a02082', 'a22082', 'a32082', 'a52082'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 3 Model B';
// result.version = result.version + ' - Rev. 1.2';
// }
// if (['a22083'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 3 Model B';
// result.version = result.version + ' - Rev. 1.3';
// }
// if (['a020d3'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 3 Model B+';
// result.version = result.version + ' - Rev. 1.3';
// }
// if (['9020e0'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 3 Model A+';
// result.version = result.version + ' - Rev. 1.3';
// }
// // Pi 2 Model B
// if (['a01040'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 2 Model B';
// result.version = result.version + ' - Rev. 1.0';
// }
// if (['a01041', 'a21041'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 2 Model B';
// result.version = result.version + ' - Rev. 1.1';
// }
// if (['a22042', 'a02042'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi 2 Model B';
// result.version = result.version + ' - Rev. 1.2';
// }
// // Compute Model
// if (['a02100'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi CM3+';
// result.version = result.version + ' - Rev 1.0';
// }
// if (['a020a0', 'a220a0'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi CM3';
// result.version = result.version + ' - Rev 1.0';
// }
// if (['900061'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi CM';
// result.version = result.version + ' - Rev 1.1';
// }
// // Pi Zero
// if (['900092', '920092'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Zero';
// result.version = result.version + ' - Rev 1.2';
// }
// if (['900093', '920093'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Zero';
// result.version = result.version + ' - Rev 1.3';
// }
// if (['9000c1'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Zero W';
// result.version = result.version + ' - Rev 1.1';
// }
// // A, B, A+ B+
// if (['0002', '0003'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model B';
// result.version = result.version + ' - Rev 1.0';
// }
// if (['0004', '0005', '0006', '000d', '000e', '000f'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model B';
// result.version = result.version + ' - Rev 2.0';
// }
// if (['0007', '0008', '0009'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model A';
// result.version = result.version + ' - Rev 2.0';
// }
// if (['0010'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model B+';
// result.version = result.version + ' - Rev 1.0';
// }
// if (['0012'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model A+';
// result.version = result.version + ' - Rev 1.0';
// }
// if (['0013', '900032'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model B+';
// result.version = result.version + ' - Rev 1.2';
// }
// if (['0015', '900021'].indexOf(result.version) >= 0) {
// result.model = result.model + ' - Pi Model A+';
// result.version = result.version + ' - Rev 1.1';
// }
// if (result.model.indexOf('Pi') !== -1 && result.version) { // Pi, Pi Zero
// result.manufacturer = 'Raspberry Pi Foundation';
// }
// }
}
if (callback) { callback(result); }
resolve(result);
@ -343,7 +234,6 @@ function system(callback) {
try {
util.powerShell('Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl').then((stdout, error) => {
if (!error) {
// let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\s\s+/);
let lines = stdout.split('\r\n');
result.manufacturer = util.getValue(lines, 'vendor', ':');
result.model = util.getValue(lines, 'name', ':');
@ -352,20 +242,22 @@ function system(callback) {
result.uuid = util.getValue(lines, 'uuid', ':').toLowerCase();
// detect virtual (1)
const model = result.model.toLowerCase();
if (model === 'virtualbox' || model === 'kvm' || model === 'virtual machine' || model === 'bochs' || model.startsWith('vmware') || model.startsWith('qemu')) {
if (model === 'virtualbox' || model === 'kvm' || model === 'virtual machine' || model === 'bochs' || model.startsWith('vmware') || model.startsWith('qemu') || model.startsWith('parallels')) {
result.virtual = true;
if (model.startsWith('virtualbox')) { result.virtualHost = 'VirtualBox'; }
if (model.startsWith('vmware')) { result.virtualHost = 'VMware'; }
if (model.startsWith('kvm')) { result.virtualHost = 'KVM'; }
if (model.startsWith('bochs')) { result.virtualHost = 'bochs'; }
if (model.startsWith('qemu')) { result.virtualHost = 'KVM'; }
if (model.startsWith('parallels')) { result.virtualHost = 'Parallels'; }
}
const manufacturer = result.manufacturer.toLowerCase();
if (manufacturer.startsWith('vmware') || manufacturer.startsWith('qemu') || manufacturer === 'xen') {
if (manufacturer.startsWith('vmware') || manufacturer.startsWith('qemu') || manufacturer === 'xen' || manufacturer.startsWith('parallels')) {
result.virtual = true;
if (manufacturer.startsWith('vmware')) { result.virtualHost = 'VMware'; }
if (manufacturer.startsWith('xen')) { result.virtualHost = 'Xen'; }
if (manufacturer.startsWith('qemu')) { result.virtualHost = 'KVM'; }
if (manufacturer.startsWith('parallels')) { result.virtualHost = 'Parallels'; }
}
util.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((stdout, error) => {
if (!error) {
@ -376,7 +268,7 @@ function system(callback) {
util.powerShell('Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion').then((stdout, error) => {
if (!error) {
let lines = stdout.toString();
if (lines.indexOf('VRTUAL') >= 0 || lines.indexOf('A M I ') >= 0 || lines.indexOf('VirtualBox') >= 0 || lines.indexOf('VMWare') >= 0 || lines.indexOf('Xen') >= 0) {
if (lines.indexOf('VRTUAL') >= 0 || lines.indexOf('A M I ') >= 0 || lines.indexOf('VirtualBox') >= 0 || lines.indexOf('VMWare') >= 0 || lines.indexOf('Xen') >= 0 || lines.indexOf('Parallels') >= 0) {
result.virtual = true;
if (lines.indexOf('VirtualBox') >= 0 && !result.virtualHost) {
result.virtualHost = 'VirtualBox';
@ -393,6 +285,9 @@ function system(callback) {
if (lines.indexOf('A M I') >= 0 && !result.virtualHost) {
result.virtualHost = 'Virtual PC';
}
if (lines.indexOf('Parallels') >= 0 && !result.virtualHost) {
result.virtualHost = 'Parallels';
}
}
if (callback) { callback(result); }
resolve(result);
@ -823,4 +718,3 @@ function chassis(callback) {
}
exports.chassis = chassis;