improved bios and main board information

This commit is contained in:
Sebastian Hildebrandt 2017-11-07 23:28:47 +01:00
parent 656fe48f27
commit bd8f00f26b
3 changed files with 31 additions and 4 deletions

View File

@ -99,6 +99,7 @@ Other changes
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 3.33.1 | 2017-11-07 | improved bios and main board information |
| 3.33.0 | 2017-11-07 | added bios and main board information |
| 3.32.4 | 2017-11-02 | AMD cpu base frequencies table also for windows |
| 3.32.3 | 2017-11-02 | code cleanup, AMD cpu base frequencies table |

View File

@ -506,13 +506,29 @@ In some cases we also discovered that `wmic` returned incorrect temperature valu
In some cases you need to install the linux `sensors` package to be able to measure temperature
e.g. on DEBIAN based systems by running `sudo apt-get install lm-sensors`
#### *: Additional Notes
## *: Additional Notes
In `fsStats`, `disksIO` and `networkStats` the results per second values (rx_sec, IOPS, ...) are calculated beginning
with the second call of the function. It is determined by calculating the difference of transferred bytes / IOs
divided by the time between two calls of the function.
#### Finding new issues
The first time you are calling oe of this functions, you will get -1 for transfer rates. The second time, you should then get statistics based on the time between the two times …
So basically, if you e.g. need a values for network stats every second, your code should look like this:
```js
const si = require('systeminformation');
setInterval(function() {
si.networkStats().then(data => {
console.log(data);
})
}, 1000)
```
Beginning with the second call, you get network transfer values per second.
## Finding new issues
I am happy to discuss any comments and suggestions. Please feel free to contact me if you see any possibility of improvement!

View File

@ -222,7 +222,7 @@ function bios(callback) {
}
if (_windows) {
// ToDo: check BIOS windows
exec('wmic bios get BIOSversion, BuildNumber, Caption, Description, IdentificationCode, Manufacturer, Name, ReleaseDate, Version /value', function (error, stdout) {
exec('wmic bios get /value', function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\r\n');
const description = util.getValue(lines, 'description', '=');
@ -230,6 +230,10 @@ function bios(callback) {
// ... Phoenix ROM BIOS PLUS Version 1.10 A04
result.vendor = description.split(' Version ')[0].trim();
result.version = description.split(' Version ')[1].trim();
} else if (description.indexOf(' Ver: ') !== -1) {
// ... BIOS Date: 06/27/16 17:50:16 Ver: 1.4.5
result.vendor = util.getValue(lines, 'manufacturer', '=');
result.version = description.split(' Ver: ')[1].trim();
} else {
result.vendor = util.getValue(lines, 'manufacturer', '=');
result.version = util.getValue(lines, 'version', '=');
@ -304,15 +308,21 @@ function baseboard(callback) {
}
if (_windows) {
// ToDo: check BIOS windows
exec('wmic baseboard get manufacturer, model, partnumber, product, serialnumber, sku, version /value', function (error, stdout) {
exec('wmic baseboard get /value', function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\r\n');
result.manufacturer = util.getValue(lines, 'manufacturer', '=');
result.model = util.getValue(lines, 'model', '=');
if (!result.model) {
result.model = util.getValue(lines, 'product', '=');
}
result.version = util.getValue(lines, 'version', '=');
result.serial = util.getValue(lines, 'serialnumber', '=');
result.assetTag = util.getValue(lines, 'partnumber', '=');
if (!result.assetTag) {
result.assetTag = util.getValue(lines, 'sku', '=');
}
}
if (callback) { callback(result); }