Merge pull request #5392 from Ylianst/bios-serial

add bios serial for windows
This commit is contained in:
Ylian Saint-Hilaire 2023-10-06 12:16:54 -07:00 committed by GitHub
commit e1b435fb0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -1825,6 +1825,15 @@ function getSystemInformation(func) {
if (results.hardware.windows.osinfo) { delete results.hardware.windows.osinfo.Node; } if (results.hardware.windows.osinfo) { delete results.hardware.windows.osinfo.Node; }
if (results.hardware.windows.partitions) { for (var i in results.hardware.windows.partitions) { delete results.hardware.windows.partitions[i].Node; } } if (results.hardware.windows.partitions) { for (var i in results.hardware.windows.partitions) { delete results.hardware.windows.partitions[i].Node; } }
} catch (ex) { } } catch (ex) { }
try {
var values = require('win-wmi').query('ROOT\\CIMV2', "SELECT * FROM Win32_Bios", ['SerialNumber']);
results.hardware.identifiers['bios_serial'] = values[0]['SerialNumber'];
} catch (ex) { }
}
if(results.hardware && results.hardware.linux) {
if (require('fs').statSync('/sys/class/dmi/id/product_serial').isFile()){
results.hardware.identifiers['bios_serial'] = require('fs').readFileSync('/sys/class/dmi/id/product_serial').toString().trim();
}
} }
results.hardware.agentvers = process.versions; results.hardware.agentvers = process.versions;
replaceSpacesWithUnderscoresRec(results); replaceSpacesWithUnderscoresRec(results);

View File

@ -5970,6 +5970,7 @@
// BIOS // BIOS
if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); } if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); }
if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); } if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); }
if (ident.bios_serial) { x += addDetailItem("Serial", EscapeHtml(ident.bios_serial), s); }
if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip' }); } if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip' }); }
// Motherboard // Motherboard

View File

@ -11665,6 +11665,7 @@
// BIOS // BIOS
if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); } if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); }
if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); } if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); }
if (ident.bios_serial) { x += addDetailItem("Serial", EscapeHtml(ident.bios_serial), s); }
if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip64.png' }); } if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip64.png' }); }
// Motherboard // Motherboard