add biosSerial/biosMode to csv (#5949)
Signed-off-by: si458 <simonsmith5521@gmail.com>
Simon Smith committed
Mar 22, 2024 at 14:31 UTC
e6ee2034d187c1e577f69f60fea5adad8782024a
1 file changed
+13
-2
meshuser.js
+13
-2
@@ -4947,7 +4947,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
4947
if (type == 'csv') {
4948
try {
4949
// Create the CSV file
4950
- output = 'id,name,rname,host,icon,ip,osdesc,groupname,av,update,firewall,bitlocker,avdetails,tags,cpu,osbuild,biosDate,biosVendor,biosVersion,boardName,boardVendor,boardVersion,productUuid,tpmversion,tpmmanufacturer,tpmmanufacturerversion,tpmisactivated,tpmisenabled,tpmisowned,totalMemory,agentOpenSSL,agentCommitDate,agentCommitHash,agentCompileTime,netIfCount,macs,addresses,lastConnectTime,lastConnectAddr\r\n';
4950
+ output = 'id,name,rname,host,icon,ip,osdesc,groupname,av,update,firewall,bitlocker,avdetails,tags,cpu,osbuild,biosDate,biosVendor,biosVersion,biosSerial,biosMode,boardName,boardVendor,boardVersion,productUuid,tpmversion,tpmmanufacturer,tpmmanufacturerversion,tpmisactivated,tpmisenabled,tpmisowned,totalMemory,agentOpenSSL,agentCommitDate,agentCommitHash,agentCompileTime,netIfCount,macs,addresses,lastConnectTime,lastConnectAddr\r\n';
4951
for (var i = 0; i < results.length; i++) {
4952
const nodeinfo = results[i];
4953
@@ -4997,6 +4997,10 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
4997
output += ',';
4998
if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.bios_version)) { output += csvClean(nodeinfo.sys.hardware.identifiers.bios_version); }
4999
output += ',';
5000
+ if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.bios_serial)) { output += csvClean(nodeinfo.sys.hardware.identifiers.bios_serial); }
5001
+ output += ',';
5002
+ if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.bios_mode)) { output += csvClean(nodeinfo.sys.hardware.identifiers.bios_mode); }
5003
+ output += ',';
5004
if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.board_name)) { output += csvClean(nodeinfo.sys.hardware.identifiers.board_name); }
5005
output += ',';
5006
if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.board_vendor)) { output += csvClean(nodeinfo.sys.hardware.identifiers.board_vendor); }
@@ -5036,6 +5040,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5040
output += ',';
5041
if (nodeinfo.sys.hardware.mobile && (nodeinfo.sys.hardware.mobile.bootloader)) { output += csvClean(nodeinfo.sys.hardware.mobile.bootloader); }
5042
output += ',';
5043
+ output += ',';
5044
+ output += ',';
5045
if (nodeinfo.sys.hardware.mobile && (nodeinfo.sys.hardware.mobile.model)) { output += csvClean(nodeinfo.sys.hardware.mobile.model); }
5046
output += ',';
5047
if (nodeinfo.sys.hardware.mobile && (nodeinfo.sys.hardware.mobile.brand)) { output += csvClean(nodeinfo.sys.hardware.mobile.brand); }
@@ -5060,6 +5066,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5066
output += ',';
5067
if (nodeinfo.sys.hardware.linux && (nodeinfo.sys.hardware.linux.bios_version)) { output += csvClean(nodeinfo.sys.hardware.linux.bios_version); }
5068
output += ',';
5069
+ if (nodeinfo.sys.hardware.linux && (nodeinfo.sys.hardware.linux.product_serial)) { output += csvClean(nodeinfo.sys.hardware.linux.product_serial); }
5070
+ else if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.bios_serial)) { output += csvClean(nodeinfo.sys.hardware.identifiers.bios_serial); }
5071
+ output += ',';
5072
+ if (nodeinfo.sys.hardware.identifiers && (nodeinfo.sys.hardware.identifiers.bios_mode)) { output += csvClean(nodeinfo.sys.hardware.identifiers.bios_mode); }
5073
+ output += ',';
5074
if (nodeinfo.sys.hardware.linux && (nodeinfo.sys.hardware.linux.board_name)) { output += csvClean(nodeinfo.sys.hardware.linux.board_name); }
5075
output += ',';
5076
if (nodeinfo.sys.hardware.linux && (nodeinfo.sys.hardware.linux.board_vendor)) { output += csvClean(nodeinfo.sys.hardware.linux.board_vendor); }
@@ -5093,7 +5104,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5104
}
5105
}
5106
} else {
5096
- output += ',,,,,,,,,,,,,,,,';
5107
+ output += ',,,,,,,,,,,,,,,,,,';
5108
}
5109
5110
// Agent information