1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added way to not save SMBIOS information in the DB.

This commit is contained in:
Ylian Saint-Hilaire 2020-04-24 13:37:37 -07:00
parent fc4f469e63
commit 7653d1c398
2 changed files with 14 additions and 11 deletions

View file

@ -1125,12 +1125,15 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
}
case 'smbios':
{
// Store the RAW SMBios table of this computer
// Perform sanity checks before storing
try {
for (var i in command.value) { var k = parseInt(i); if ((k != i) || (i > 255) || (typeof command.value[i] != 'object') || (command.value[i].length == null) || (command.value[i].length > 1024) || (command.value[i].length < 0)) { delete command.value[i]; } }
db.SetSMBIOS({ _id: obj.dbNodeKey, domain: domain.id, time: new Date(), value: command.value });
} catch (ex) { }
// See if we need to save SMBIOS information
if (domain.smbios !== false) {
// Store the RAW SMBios table of this computer
// Perform sanity checks before storing
try {
for (var i in command.value) { var k = parseInt(i); if ((k != i) || (i > 255) || (typeof command.value[i] != 'object') || (command.value[i].length == null) || (command.value[i].length > 1024) || (command.value[i].length < 0)) { delete command.value[i]; } }
db.SetSMBIOS({ _id: obj.dbNodeKey, domain: domain.id, time: new Date(), value: command.value });
} catch (ex) { }
}
// Event the node interface information change (This is a lot of traffic, probably don't need this).
//parent.parent.DispatchEvent(parent.CreateMeshDispatchTargets(obj.meshid, [obj.dbNodeKey]), obj, { action: 'smBiosChange', nodeid: obj.dbNodeKey, domain: domain.id, smbios: command.value, nolog: 1 });