systeminformation icon indicating copy to clipboard operation
systeminformation copied to clipboard

Some functions are just returning objects with all the fields null or blank

Open westhecool opened this issue 2 years ago • 10 comments

Describe the bug Some functions are just returning objects with all the fields null or blank:

si.cpu():

{
  "manufacturer": "",
  "brand": "",
  "vendor": "",
  "family": "",
  "model": "",
  "stepping": "",
  "revision": "",
  "voltage": "",
  "speed": null,
  "speedMin": null,
  "speedMax": null,
  "governor": "",
  "cores": 16,
  "physicalCores": 16,
  "performanceCores": 16,
  "efficiencyCores": 0,
  "processors": 1,
  "socket": "",
  "flags": "de pse mce sep mtrr mca cmov psn clfsh ds acpi mmx fxsr sse sse2 ss htt tm ia64 pbe",
  "virtualization": false,
  "cache": {
    "l1d": 0,
    "l1i": 0,
    "l2": "",
    "l3": ""
  }
}

si.cpuTemperature():

{
  "main": null,
  "cores": [],
  "max": null,
  "socket": [],
  "chipset": null
}

si.networkStats():

[
  {
    "iface": "wi-fi",
    "operstate": "unknown",
    "rx_bytes": 0,
    "rx_dropped": 0,
    "rx_errors": 0,
    "tx_bytes": 0,
    "tx_dropped": 0,
    "tx_errors": 0,
    "rx_sec": null,
    "tx_sec": null,
    "ms": 0
  }
]

I have yet to test more functions but it doesn't seem like most of them are working.

Edit:

The following functions aren't working right for me: cpuTemperature, cpuCurrentSpeed, disksIO, fsOpenFiles, fsStats, networkStats

Environment (please complete the following information):

  • systeminformation package version: 5.17.3
  • OS: windows 11

westhecool avatar Jan 13 '23 21:01 westhecool

the same for me

EvoluWil avatar Jan 19 '23 10:01 EvoluWil

Looks like what happened between versions 5.8 and 5.9

5.8 works for me 5.9 returns blank and null values

try to run

npm install [email protected]

EvoluWil avatar Jan 19 '23 11:01 EvoluWil

Looks like what happened between versions 5.8 and 5.9

5.8 works for me 5.9 returns blank and null values

try to run

npm install [email protected]

that at least fixed si.cpu() and si.networkStats() for me. si.cpuCurrentSpeed() is working it's just not returning accurate data.

westhecool avatar Jan 19 '23 12:01 westhecool

@westhecool @Willian-Rodrigues ... In 5.9.10 I switched completely from wmic to the respective powershell commands as wmic is deprecated and missing in the newest windows versions.

Can you determine your powershell version on the your machines? I had a user where powershell was not installed and this was the reason for not getting results.

sebhildebrandt avatar Jan 29 '23 19:01 sebhildebrandt

@westhecool @Willian-Rodrigues ... In 5.9.10 I switched completely from wmic to the respective powershell commands as wmic is deprecated and missing in the newest windows versions.

Can you determine your powershell version on the your machines? I had a user where powershell was not installed and this was the reason for not getting results.

Name                           Value
----                           -----
PSVersion                      5.1.22000.1335
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22000.1335
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

westhecool avatar Jan 29 '23 23:01 westhecool

@westhecool .. as it is still not clear when exactly it stopped working on your side, can you maybe try version 5.9.7 and 5.9.10 separately? Between those versions I made the powerShell transitions.

To get the specific version:

npm install [email protected]
npm install [email protected]

Then try running this code snippet:

const si = require('systeminformation');
si.cpu().then(data => console.log(data));

Thank you for testing.

sebhildebrandt avatar Jan 30 '23 05:01 sebhildebrandt

disksIO

I ran that test and it worked fine on both versions. There were some functions that weren't working for me: si.cpuCurrentSpeed() is returning a fixed rate and not changing. And these following functions just returned blank values: cpuTemperature, disksIO, fsOpenFiles, fsStats

westhecool avatar Feb 01 '23 13:02 westhecool

@westhecool As you can see in the documentation https://systeminformation.io

disksIO, fsOpenFiles, fsStats are not supported currently for windows, and for cpuTemperature also this depends highly how the BIOS supports this. See https://systeminformation.io/issues.html

So the question is (referring to the original post) ... from which version exactly the si.cpu() stopped working ...?

sebhildebrandt avatar Feb 01 '23 13:02 sebhildebrandt

@westhecool As you can see in the documentation https://systeminformation.io

disksIO, fsOpenFiles, fsStats are not supported currently for windows, and for cpuTemperature also this depends highly how the BIOS supports this. See https://systeminformation.io/issues.html

So the question is (referring to the original post) ... from which version exactly the si.cpu() stopped working ...?

It worked about half of the time when I was using v5.17.3

westhecool avatar Feb 03 '23 12:02 westhecool

Having the same issue, anything above version 5.9.15 does not return proper data.

using win 11, node 18.14.2, PSVersion 5.1.22621.963

mistenkt avatar Apr 05 '23 17:04 mistenkt