Fixed Win7 crash, Local AMT scanner

This commit is contained in:
Ylian Saint-Hilaire 2018-07-27 13:53:50 -07:00
parent d8a955629b
commit 6d8a93ad5a
7 changed files with 3 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -110,8 +110,7 @@ module.exports.CreateAmtScanner = function (parent) {
// Look for all AMT computers that may be locally reachable and poll their presence
obj.performScan = function () {
//console.log('performScan');
if (obj.action == false) { return false; }
if (obj.active == false) { return false; }
obj.parent.db.getLocalAmtNodes(10, function (err, docs) { // TODO: handler more than 10 computer scan at the same time. DNS resolved may need to be a seperate module.
for (var i in obj.scanTable) { obj.scanTable[i].present = false; }
if (err == null && docs.length > 0) {

2
db.js
View File

@ -109,7 +109,7 @@ module.exports.CreateDB = function (parent) {
obj.dispose = function () { for (var x in obj) { if (obj[x].close) { obj[x].close(); } delete obj[x]; } }
obj.clearOldEntries = function (type, days, domain) { var cutoff = Date.now() - (1000 * 60 * 60 * 24 * days); obj.file.remove({ type: type, time: { $lt: cutoff } }, { multi: true }); }
obj.getPowerTimeline = function (nodeid, func) { if (obj.databaseType == 1) { obj.file.find({ type: 'power', node: { $in: ['*', nodeid] } }).sort({ time: 1 }).exec(func); } else { obj.file.find({ type: 'power', node: { $in: ['*', nodeid] } }).sort({ time: 1 }, func); } }
obj.getLocalAmtNodes = function (limit, func) { obj.file.find({ type: 'node', host: { $exists: true, $ne: null }, intelamt: { $exists: true } }).limit(limit, func); }
obj.getLocalAmtNodes = function (limit, func) { obj.file.find({ type: 'node', host: { $exists: true, $ne: null }, intelamt: { $exists: true } }).limit(limit).exec(func); }
obj.getAmtUuidNode = function (meshid, uuid, func) { obj.file.find({ type: 'node', meshid: meshid, 'intelamt.uuid': uuid }, func); }
// This is used to rate limit a number of operation per day. Returns a startValue each new days, but you can substract it and save the value in the db.

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.1.9-b",
"version": "0.1.9-c",
"keywords": [
"Remote Management",
"Intel AMT",