Fixed Intel AMT network scanning to use DNS name.

This commit is contained in:
Ylian Saint-Hilaire 2020-04-20 03:22:33 -07:00
parent 955e6f168e
commit 6e247f547f
2 changed files with 4 additions and 4 deletions

View File

@ -296,9 +296,9 @@ module.exports.CreateAmtScanner = function (parent) {
//var provisioningStates = { 0: 'Pre', 1: 'in', 2: 'Post' }; //var provisioningStates = { 0: 'Pre', 1: 'in', 2: 'Post' };
//var provisioningStateStr = provisioningStates[provisioningState]; //var provisioningStateStr = provisioningStates[provisioningState];
//console.log(rinfo.address + ': Intel AMT ' + majorVersion + '.' + minorVersion + ', ' + provisioningStateStr + '-Provisioning, Open Ports: [' + openPorts.join(', ') + ']'); //console.log(rinfo.address + ': Intel AMT ' + majorVersion + '.' + minorVersion + ', ' + provisioningStateStr + '-Provisioning, Open Ports: [' + openPorts.join(', ') + ']');
obj.dns.reverse(rinfo.address, function (err, hostname) { obj.dns.reverse(rinfo.address, function (err, hostnames) {
if ((err != undefined) && (hostname != undefined)) { if ((err == null) && (hostnames != null) && (hostnames.length > 0)) {
user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: hostname[0] }; user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: hostnames[0] };
} else { } else {
user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: rinfo.address }; user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: rinfo.address };
} }

View File

@ -3535,7 +3535,7 @@
if (elements[i].checked) { if (elements[i].checked) {
var ipaddr = elements[i].getAttribute('tag'); var ipaddr = elements[i].getAttribute('tag');
var amtinfo = amtScanResults[ipaddr]; var amtinfo = amtScanResults[ipaddr];
meshserver.send({ action: 'addamtdevice', meshid: meshid, devicename: ipaddr, hostname: amtinfo.hostname, amtusername: '', amtpassword: '', amttls: amtinfo.tls }); meshserver.send({ action: 'addamtdevice', meshid: meshid, devicename: amtinfo.hostname, hostname: amtinfo.hostname, amtusername: '', amtpassword: '', amttls: amtinfo.tls });
} }
} }
} }