systeminformation 5.10.7 → 5.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/lib/audio.js +1 -1
- package/lib/battery.js +1 -1
- package/lib/bluetooth.js +1 -1
- package/lib/cpu.js +4 -4
- package/lib/filesystem.js +5 -4
- package/lib/memory.js +1 -1
- package/lib/network.js +41 -2
- package/lib/osinfo.js +12 -4
- package/lib/printer.js +1 -1
- package/lib/processes.js +3 -3
- package/lib/system.js +5 -5
- package/lib/usb.js +1 -1
- package/lib/users.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
[![Sponsoring][sponsor-badge]][sponsor-url]
|
|
31
31
|
[![MIT license][license-img]][license-url]
|
|
32
32
|
|
|
33
|
-
This is amazing. Started as a small project just for myself, it now has >
|
|
33
|
+
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 4 mio downloads per month, > 60 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
|
|
34
34
|
|
|
35
35
|
## New Version 5.0
|
|
36
36
|
|
|
@@ -101,6 +101,7 @@ si.cpu()
|
|
|
101
101
|
|
|
102
102
|
(last 7 major and minor version releases)
|
|
103
103
|
|
|
104
|
+
- Version 5.11.0: `networkInterfaces()` added default property and default parameter
|
|
104
105
|
- Version 5.10.0: basic `android` support
|
|
105
106
|
- Version 5.9.0: `graphics()` added properties (macOS)
|
|
106
107
|
- Version 5.8.0: `disksIO()` added waitTime, waitPercent (linux)
|
|
@@ -539,9 +540,10 @@ Full function reference with examples can be found at [https://systeminformation
|
|
|
539
540
|
|
|
540
541
|
| Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
|
|
541
542
|
| --------------- | ------------- | ----- | ------- | --- | --- | --- | -------- |
|
|
542
|
-
| si.networkInterfaces(cb) | [{...}] | X | X | X | X | X | array of network interfaces |
|
|
543
|
+
| si.networkInterfaces(cb) | [{...}] | X | X | X | X | X | array of network interfaces<br>With the 'default' parameter it returns<br>only the default interface |
|
|
543
544
|
| | [0].iface | X | X | X | X | X | interface |
|
|
544
545
|
| | [0].ifaceName | X | X | X | X | X | interface name (differs on Windows) |
|
|
546
|
+
| | [0].default | X | X | X | X | X | true if this is the default interface |
|
|
545
547
|
| | [0].ip4 | X | X | X | X | X | ip4 address |
|
|
546
548
|
| | [0].ip4subnet | X | X | X | X | X | ip4 subnet mask |
|
|
547
549
|
| | [0].ip6 | X | X | X | X | X | ip6 address |
|
|
@@ -917,13 +919,15 @@ e.g. on DEBIAN based systems by running `sudo apt-get install lm-sensors`
|
|
|
917
919
|
|
|
918
920
|
To be able to detect S.M.A.R.T. status on Linux you need to install `smartmontools`. On DEBIAN based Linux distributions you can install it by running `sudo apt-get install smartmontools`
|
|
919
921
|
|
|
922
|
+
#### Windows Encoding Issues
|
|
923
|
+
I now reimplemented all windows functions to avoid encoding problems (special chacarters). And as Windows 11 now droppend `wmic` support, I had to move completely to `powershell`. Be sure that powershell version 5+ is installed on your machine. On older Windows versions (7, 8) you might still see encoding problems due to the old powershell version.
|
|
920
924
|
## *: Additional Notes
|
|
921
925
|
|
|
922
926
|
In `fsStats()`, `disksIO()` and `networkStats()` the results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning
|
|
923
927
|
with the second call of the function. It is determined by calculating the difference of transferred bytes / IOs
|
|
924
928
|
divided by the time between two calls of the function.
|
|
925
929
|
|
|
926
|
-
The first time you are calling one of these functions, you will get
|
|
930
|
+
The first time you are calling one of these functions, you will get `null` for transfer rates. The second time, you should then get statistics based on the time between the two calls ...
|
|
927
931
|
|
|
928
932
|
So basically, if you e.g. need a value for network stats every second, your code should look like this:
|
|
929
933
|
|
package/lib/audio.js
CHANGED
|
@@ -194,7 +194,7 @@ function audio(callback) {
|
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
if (_windows) {
|
|
197
|
-
util.powerShell('Get-WmiObject Win32_SoundDevice | fl
|
|
197
|
+
util.powerShell('Get-WmiObject Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl').then((stdout, error) => {
|
|
198
198
|
if (!error) {
|
|
199
199
|
const parts = stdout.toString().split(/\n\s*\n/);
|
|
200
200
|
for (let i = 0; i < parts.length; i++) {
|
package/lib/battery.js
CHANGED
|
@@ -225,7 +225,7 @@ module.exports = function (callback) {
|
|
|
225
225
|
if (_windows) {
|
|
226
226
|
try {
|
|
227
227
|
const workload = [];
|
|
228
|
-
workload.push(util.powerShell('Get-WmiObject Win32_Battery | fl
|
|
228
|
+
workload.push(util.powerShell('Get-WmiObject Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl'));
|
|
229
229
|
workload.push(util.powerShell('(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity'));
|
|
230
230
|
workload.push(util.powerShell('(Get-WmiObject -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity'));
|
|
231
231
|
util.promiseAll(
|
package/lib/bluetooth.js
CHANGED
|
@@ -158,7 +158,7 @@ function bluetoothDevices(callback) {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
if (_windows) {
|
|
161
|
-
util.powerShell('Get-WmiObject Win32_PNPEntity | fl
|
|
161
|
+
util.powerShell('Get-WmiObject Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl').then((stdout, error) => {
|
|
162
162
|
if (!error) {
|
|
163
163
|
const parts = stdout.toString().split(/\n\s*\n/);
|
|
164
164
|
for (let i = 0; i < parts.length; i++) {
|
package/lib/cpu.js
CHANGED
|
@@ -797,8 +797,8 @@ function getCpu() {
|
|
|
797
797
|
if (_windows) {
|
|
798
798
|
try {
|
|
799
799
|
const workload = [];
|
|
800
|
-
workload.push(util.powerShell('Get-WmiObject Win32_processor | fl
|
|
801
|
-
workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl
|
|
800
|
+
workload.push(util.powerShell('Get-WmiObject Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl'));
|
|
801
|
+
workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl'));
|
|
802
802
|
// workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
|
803
803
|
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
|
804
804
|
|
|
@@ -1425,7 +1425,7 @@ function cpuCache(callback) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
if (_windows) {
|
|
1427
1427
|
try {
|
|
1428
|
-
util.powerShell('Get-WmiObject Win32_processor | fl
|
|
1428
|
+
util.powerShell('Get-WmiObject Win32_processor | select L2CacheSize, L3CacheSize | fl').then((stdout, error) => {
|
|
1429
1429
|
if (!error) {
|
|
1430
1430
|
let lines = stdout.split('\r\n');
|
|
1431
1431
|
result.l1d = 0;
|
|
@@ -1435,7 +1435,7 @@ function cpuCache(callback) {
|
|
|
1435
1435
|
if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }
|
|
1436
1436
|
if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }
|
|
1437
1437
|
}
|
|
1438
|
-
util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl
|
|
1438
|
+
util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl').then((stdout, error) => {
|
|
1439
1439
|
if (!error) {
|
|
1440
1440
|
const parts = stdout.split(/\n\s*\n/);
|
|
1441
1441
|
parts.forEach(function (part) {
|
package/lib/filesystem.js
CHANGED
|
@@ -127,7 +127,7 @@ function fsSize(callback) {
|
|
|
127
127
|
if (_windows) {
|
|
128
128
|
try {
|
|
129
129
|
// util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {
|
|
130
|
-
util.powerShell('Get-WmiObject Win32_logicaldisk | fl
|
|
130
|
+
util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,FileSystem,FreeSpace,Size | fl').then((stdout, error) => {
|
|
131
131
|
if (!error) {
|
|
132
132
|
let devices = stdout.toString().split(/\n\s*\n/);
|
|
133
133
|
devices.forEach(function (device) {
|
|
@@ -400,7 +400,8 @@ function blockDevices(callback) {
|
|
|
400
400
|
let drivetypes = ['Unknown', 'NoRoot', 'Removable', 'Local', 'Network', 'CD/DVD', 'RAM'];
|
|
401
401
|
try {
|
|
402
402
|
// util.wmic('logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value').then((stdout, error) => {
|
|
403
|
-
util.powerShell('Get-
|
|
403
|
+
// util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {
|
|
404
|
+
util.powerShell('Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {
|
|
404
405
|
if (!error) {
|
|
405
406
|
let devices = stdout.toString().split(/\n\s*\n/);
|
|
406
407
|
devices.forEach(function (device) {
|
|
@@ -1167,8 +1168,8 @@ function diskLayout(callback) {
|
|
|
1167
1168
|
if (_windows) {
|
|
1168
1169
|
try {
|
|
1169
1170
|
const workload = [];
|
|
1170
|
-
workload.push(util.powerShell('Get-WmiObject Win32_DiskDrive | fl
|
|
1171
|
-
workload.push(util.powerShell('Get-PhysicalDisk |
|
|
1171
|
+
workload.push(util.powerShell('Get-WmiObject Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl'));
|
|
1172
|
+
workload.push(util.powerShell('Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl'));
|
|
1172
1173
|
if (util.smartMonToolsInstalled()) {
|
|
1173
1174
|
try {
|
|
1174
1175
|
const smartDev = JSON.parse(execSync('smartctl --scan -j'));
|
package/lib/memory.js
CHANGED
|
@@ -504,7 +504,7 @@ function memLayout(callback) {
|
|
|
504
504
|
const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
|
|
505
505
|
|
|
506
506
|
try {
|
|
507
|
-
util.powerShell('Get-WmiObject Win32_PhysicalMemory | fl
|
|
507
|
+
util.powerShell('Get-WmiObject Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl').then((stdout, error) => {
|
|
508
508
|
if (!error) {
|
|
509
509
|
let devices = stdout.toString().split(/\n\s*\n/);
|
|
510
510
|
devices.shift();
|
package/lib/network.js
CHANGED
|
@@ -692,17 +692,29 @@ function testVirtualNic(iface, ifaceName, mac) {
|
|
|
692
692
|
} else { return false; }
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
function networkInterfaces(callback, rescan) {
|
|
695
|
+
function networkInterfaces(callback, rescan, defaultString) {
|
|
696
|
+
|
|
697
|
+
if (typeof callback === 'string') {
|
|
698
|
+
defaultString = callback;
|
|
699
|
+
rescan = true;
|
|
700
|
+
callback = null;
|
|
701
|
+
}
|
|
696
702
|
|
|
697
703
|
if (typeof callback === 'boolean') {
|
|
698
704
|
rescan = callback;
|
|
699
705
|
callback = null;
|
|
706
|
+
defaultString = '';
|
|
700
707
|
}
|
|
701
708
|
if (typeof rescan === 'undefined') {
|
|
702
709
|
rescan = true;
|
|
703
710
|
}
|
|
711
|
+
defaultString = defaultString || '';
|
|
712
|
+
defaultString = '' + defaultString;
|
|
713
|
+
|
|
704
714
|
return new Promise((resolve) => {
|
|
705
715
|
process.nextTick(() => {
|
|
716
|
+
const defaultInterface = getDefaultNetworkInterface();
|
|
717
|
+
|
|
706
718
|
let ifaces = os.networkInterfaces();
|
|
707
719
|
|
|
708
720
|
let result = [];
|
|
@@ -730,6 +742,7 @@ function networkInterfaces(callback, rescan) {
|
|
|
730
742
|
result.push({
|
|
731
743
|
iface: nic.iface,
|
|
732
744
|
ifaceName: nic.iface,
|
|
745
|
+
default: nic.iface === defaultInterface,
|
|
733
746
|
ip4: nic.ip4,
|
|
734
747
|
ip4subnet: nic.ip4subnet || '',
|
|
735
748
|
ip6: nic.ip6,
|
|
@@ -750,6 +763,14 @@ function networkInterfaces(callback, rescan) {
|
|
|
750
763
|
});
|
|
751
764
|
});
|
|
752
765
|
_networkInterfaces = result;
|
|
766
|
+
if (defaultString.toLowerCase().indexOf('default') >= 0) {
|
|
767
|
+
result = result.filter(item => item.default);
|
|
768
|
+
if (result.length > 0) {
|
|
769
|
+
result = result[0];
|
|
770
|
+
} else {
|
|
771
|
+
result = [];
|
|
772
|
+
}
|
|
773
|
+
}
|
|
753
774
|
if (callback) { callback(result); }
|
|
754
775
|
resolve(result);
|
|
755
776
|
}
|
|
@@ -863,6 +884,7 @@ function networkInterfaces(callback, rescan) {
|
|
|
863
884
|
result.push({
|
|
864
885
|
iface,
|
|
865
886
|
ifaceName,
|
|
887
|
+
default: iface === defaultInterface,
|
|
866
888
|
ip4,
|
|
867
889
|
ip4subnet,
|
|
868
890
|
ip6,
|
|
@@ -884,6 +906,14 @@ function networkInterfaces(callback, rescan) {
|
|
|
884
906
|
}
|
|
885
907
|
}
|
|
886
908
|
_networkInterfaces = result;
|
|
909
|
+
if (defaultString.toLowerCase().indexOf('default') >= 0) {
|
|
910
|
+
result = result.filter(item => item.default);
|
|
911
|
+
if (result.length > 0) {
|
|
912
|
+
result = result[0];
|
|
913
|
+
} else {
|
|
914
|
+
result = [];
|
|
915
|
+
}
|
|
916
|
+
}
|
|
887
917
|
if (callback) { callback(result); }
|
|
888
918
|
resolve(result);
|
|
889
919
|
}
|
|
@@ -990,6 +1020,7 @@ function networkInterfaces(callback, rescan) {
|
|
|
990
1020
|
result.push({
|
|
991
1021
|
iface,
|
|
992
1022
|
ifaceName,
|
|
1023
|
+
default: iface === defaultInterface,
|
|
993
1024
|
ip4,
|
|
994
1025
|
ip4subnet,
|
|
995
1026
|
ip6,
|
|
@@ -1011,6 +1042,14 @@ function networkInterfaces(callback, rescan) {
|
|
|
1011
1042
|
}
|
|
1012
1043
|
}
|
|
1013
1044
|
_networkInterfaces = result;
|
|
1045
|
+
if (defaultString.toLowerCase().indexOf('default') >= 0) {
|
|
1046
|
+
result = result.filter(item => item.default);
|
|
1047
|
+
if (result.length > 0) {
|
|
1048
|
+
result = result[0];
|
|
1049
|
+
} else {
|
|
1050
|
+
result = [];
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1014
1053
|
if (callback) { callback(result); }
|
|
1015
1054
|
resolve(result);
|
|
1016
1055
|
});
|
|
@@ -1267,7 +1306,7 @@ function networkStatsSingle(iface) {
|
|
|
1267
1306
|
let ifaceName = ifaceSanitized;
|
|
1268
1307
|
|
|
1269
1308
|
// Performance Data
|
|
1270
|
-
util.powerShell('Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface | fl
|
|
1309
|
+
util.powerShell('Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl').then((stdout, error) => {
|
|
1271
1310
|
if (!error) {
|
|
1272
1311
|
const psections = stdout.toString().split(/\n\s*\n/);
|
|
1273
1312
|
perfData = parseLinesWindowsPerfData(psections);
|
package/lib/osinfo.js
CHANGED
|
@@ -167,7 +167,7 @@ function getLogoFile(distro) {
|
|
|
167
167
|
|
|
168
168
|
function getFQDN() {
|
|
169
169
|
let fqdn = os.hostname;
|
|
170
|
-
if (_linux || _darwin
|
|
170
|
+
if (_linux || _darwin) {
|
|
171
171
|
try {
|
|
172
172
|
const stdout = execSync('hostname -f');
|
|
173
173
|
fqdn = stdout.toString().split(os.EOL)[0];
|
|
@@ -175,6 +175,14 @@ function getFQDN() {
|
|
|
175
175
|
util.noop();
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
+
if (_freebsd || _openbsd || _netbsd) {
|
|
179
|
+
try {
|
|
180
|
+
const stdout = execSync('hostname');
|
|
181
|
+
fqdn = stdout.toString().split(os.EOL)[0];
|
|
182
|
+
} catch (e) {
|
|
183
|
+
util.noop();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
178
186
|
if (_windows) {
|
|
179
187
|
try {
|
|
180
188
|
const stdout = execSync('echo %COMPUTERNAME%.%USERDNSDOMAIN%', util.execOptsWin);
|
|
@@ -322,7 +330,7 @@ function osInfo(callback) {
|
|
|
322
330
|
result.release = result.kernel;
|
|
323
331
|
try {
|
|
324
332
|
const workload = [];
|
|
325
|
-
workload.push(util.powerShell('Get-WmiObject Win32_OperatingSystem | fl
|
|
333
|
+
workload.push(util.powerShell('Get-WmiObject Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl'));
|
|
326
334
|
// workload.push(execPromise('systeminfo', util.execOptsWin));
|
|
327
335
|
// workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
|
328
336
|
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
|
@@ -737,7 +745,7 @@ function versions(apps, callback) {
|
|
|
737
745
|
});
|
|
738
746
|
} else {
|
|
739
747
|
if (_windows) {
|
|
740
|
-
util.powerShell('Get-WmiObject Win32_Service | fl
|
|
748
|
+
util.powerShell('Get-WmiObject Win32_Service | select caption | fl').then((stdout) => {
|
|
741
749
|
let serviceSections = stdout.split(/\n\s*\n/);
|
|
742
750
|
for (let i = 0; i < serviceSections.length; i++) {
|
|
743
751
|
if (serviceSections[i].trim() !== '') {
|
|
@@ -1132,7 +1140,7 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;
|
|
|
1132
1140
|
if (process.arch === 'ia32' && Object.prototype.hasOwnProperty.call(process.env, 'PROCESSOR_ARCHITEW6432')) {
|
|
1133
1141
|
sysdir = '%windir%\\sysnative\\cmd.exe /c %windir%\\System32';
|
|
1134
1142
|
}
|
|
1135
|
-
util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | fl
|
|
1143
|
+
util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select UUID | fl').then((stdout) => {
|
|
1136
1144
|
// let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\s\s+/);
|
|
1137
1145
|
let lines = stdout.split('\r\n');
|
|
1138
1146
|
result.hardware = util.getValue(lines, 'uuid', ':').toLowerCase();
|
package/lib/printer.js
CHANGED
|
@@ -186,7 +186,7 @@ function printer(callback) {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
if (_windows) {
|
|
189
|
-
util.powerShell('Get-WmiObject Win32_Printer | fl
|
|
189
|
+
util.powerShell('Get-WmiObject Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl').then((stdout, error) => {
|
|
190
190
|
if (!error) {
|
|
191
191
|
const parts = stdout.toString().split(/\n\s*\n/);
|
|
192
192
|
for (let i = 0; i < parts.length; i++) {
|
package/lib/processes.js
CHANGED
|
@@ -332,7 +332,7 @@ function services(srv, callback) {
|
|
|
332
332
|
}
|
|
333
333
|
wincommand = `${wincommand.slice(0, -4)}"`;
|
|
334
334
|
}
|
|
335
|
-
wincommand += ' | fl
|
|
335
|
+
wincommand += ' | select Name,Caption,Started,StartMode,ProcessId | fl';
|
|
336
336
|
util.powerShell(wincommand).then((stdout, error) => {
|
|
337
337
|
if (!error) {
|
|
338
338
|
let serviceSections = stdout.split(/\n\s*\n/);
|
|
@@ -797,7 +797,7 @@ function processes(callback) {
|
|
|
797
797
|
});
|
|
798
798
|
} else if (_windows) {
|
|
799
799
|
try {
|
|
800
|
-
util.powerShell('Get-WmiObject Win32_Process | fl
|
|
800
|
+
util.powerShell('Get-WmiObject Win32_Process | select ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,CreationDate | fl').then((stdout, error) => {
|
|
801
801
|
if (!error) {
|
|
802
802
|
let processSections = stdout.split(/\n\s*\n/);
|
|
803
803
|
let procs = [];
|
|
@@ -969,7 +969,7 @@ function processLoad(proc, callback) {
|
|
|
969
969
|
if (procSanitized && processes.length && processes[0] !== '------') {
|
|
970
970
|
if (_windows) {
|
|
971
971
|
try {
|
|
972
|
-
util.powerShell('Get-WmiObject Win32_Process | fl
|
|
972
|
+
util.powerShell('Get-WmiObject Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl').then((stdout, error) => {
|
|
973
973
|
if (!error) {
|
|
974
974
|
let processSections = stdout.split(/\n\s*\n/);
|
|
975
975
|
let procStats = [];
|
package/lib/system.js
CHANGED
|
@@ -343,7 +343,7 @@ function system(callback) {
|
|
|
343
343
|
}
|
|
344
344
|
if (_windows) {
|
|
345
345
|
try {
|
|
346
|
-
util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | fl
|
|
346
|
+
util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl').then((stdout, error) => {
|
|
347
347
|
if (!error) {
|
|
348
348
|
// let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\s\s+/);
|
|
349
349
|
let lines = stdout.split('\r\n');
|
|
@@ -369,7 +369,7 @@ function system(callback) {
|
|
|
369
369
|
if (manufacturer.startsWith('xen')) { result.virtualHost = 'Xen'; }
|
|
370
370
|
if (manufacturer.startsWith('qemu')) { result.virtualHost = 'KVM'; }
|
|
371
371
|
}
|
|
372
|
-
util.powerShell('Get-WmiObject MS_Systeminformation -Namespace "root/wmi" | fl
|
|
372
|
+
util.powerShell('Get-WmiObject MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((stdout, error) => {
|
|
373
373
|
if (!error) {
|
|
374
374
|
let lines = stdout.split('\r\n');
|
|
375
375
|
result.sku = util.getValue(lines, 'systemsku', ':');
|
|
@@ -506,7 +506,7 @@ function bios(callback) {
|
|
|
506
506
|
}
|
|
507
507
|
if (_windows) {
|
|
508
508
|
try {
|
|
509
|
-
util.powerShell('Get-WmiObject Win32_bios | fl
|
|
509
|
+
util.powerShell('Get-WmiObject Win32_bios | select Description,Version,Manufacturer,ReleaseDate,BuildNumber,SerialNumber | fl').then((stdout, error) => {
|
|
510
510
|
if (!error) {
|
|
511
511
|
let lines = stdout.toString().split('\r\n');
|
|
512
512
|
const description = util.getValue(lines, 'description', ':');
|
|
@@ -662,7 +662,7 @@ function baseboard(callback) {
|
|
|
662
662
|
if (_windows) {
|
|
663
663
|
try {
|
|
664
664
|
const workload = [];
|
|
665
|
-
workload.push(util.powerShell('Get-WmiObject Win32_baseboard | fl
|
|
665
|
+
workload.push(util.powerShell('Get-WmiObject Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
|
|
666
666
|
workload.push(util.powerShell('Get-WmiObject Win32_physicalmemoryarray | select MaxCapacity, MemoryDevices | fl'));
|
|
667
667
|
util.promiseAll(
|
|
668
668
|
workload
|
|
@@ -795,7 +795,7 @@ function chassis(callback) {
|
|
|
795
795
|
}
|
|
796
796
|
if (_windows) {
|
|
797
797
|
try {
|
|
798
|
-
util.powerShell('Get-WmiObject Win32_SystemEnclosure | fl
|
|
798
|
+
util.powerShell('Get-WmiObject Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU | fl').then((stdout, error) => {
|
|
799
799
|
if (!error) {
|
|
800
800
|
let lines = stdout.toString().split('\r\n');
|
|
801
801
|
|
package/lib/usb.js
CHANGED
|
@@ -263,7 +263,7 @@ function usb(callback) {
|
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
if (_windows) {
|
|
266
|
-
util.powerShell('Get-WmiObject CIM_LogicalDevice | where { $_.Description -match "USB"}').then((stdout, error) => {
|
|
266
|
+
util.powerShell('Get-WmiObject CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((stdout, error) => {
|
|
267
267
|
if (!error) {
|
|
268
268
|
const parts = stdout.toString().split(/\n\s*\n/);
|
|
269
269
|
for (let i = 0; i < parts.length; i++) {
|
package/lib/users.js
CHANGED
|
@@ -253,8 +253,8 @@ function users(callback) {
|
|
|
253
253
|
// Promise.all(
|
|
254
254
|
// workload
|
|
255
255
|
// ).then(data => {
|
|
256
|
-
let cmd = 'Get-WmiObject Win32_LogonSession | fl
|
|
257
|
-
cmd += 'Get-WmiObject Win32_LoggedOnUser | fl
|
|
256
|
+
let cmd = 'Get-WmiObject Win32_LogonSession | select LogonId,StartTime | fl' + '; echo \'#-#-#-#\';';
|
|
257
|
+
cmd += 'Get-WmiObject Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \'#-#-#-#\';';
|
|
258
258
|
cmd += 'Get-WmiObject Win32_Process -Filter "name=\'explorer.exe\'" | Select @{Name="sessionid";Expression={$_.SessionId}}, @{Name="domain";Expression={$_.GetOwner().Domain}}, @{Name="username";Expression={$_.GetOwner().User}} | fl' + '; echo \'#-#-#-#\';';
|
|
259
259
|
cmd += 'query user';
|
|
260
260
|
util.powerShell(cmd).then(data => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.3",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|