1. Added instrumentation 2. Fixed bug with amtuuid when specifying remote host

1. Added instrumentation 2. Fixed bug with amtuuid when specifying remote host

Bryan Roe committed Oct 6, 2021 at 13:11 UTC 0b3799838b9fa6f30e15f13c975cd70aada0fc40
1 file changed +8 -7
agents/meshcmd.js
+8 -7
@@ -166,6 +166,7 @@ function run(argv) {
166 if (args.json) { settings.json = true; }
167 if (args.tls) { settings.tls = true; }
168 if ((argv.length > 1) && (actions.indexOf(argv[1].toUpperCase()) >= 0)) { settings.action = argv[1]; }
169 + if (globalDebugFlags != 0) { console.setInfoLevel(1); }
170
171 // Validate meshaction.txt
172 if (settings.action == null) {
@@ -1394,13 +1395,13 @@ function getTrustedHashes(amtMei, func, tag) {
1395 //
1396
1397 // Called to get the UUID of Intel AMT, start by setting up MicroLMS if we are doing the operation on the local computer
1397 -function getAmtUuid() {
1398 - if (settings.hostname == null) {
1399 - var amtMeiModule, amtMei;
1400 - try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { console.log(ex); exit(1); return; }
1401 - amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; });
1402 - amtMei.getUuid(function (result) { if ((result == null) || (result.uuid == null)) { console.log('Failed.'); } else { console.log(result.uuid); } exit(1); });
1403 - } else {
1398 +function getAmtUuid()
1399 +{
1400 + if (settings.hostname != null)
1401 + {
1402 + getAmtUuidEx();
1403 + } else
1404 + {
1405 if ((settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) { settings.noconsole = true; startLms(getAmtUuidEx); return; } else { getAmtUuidEx(); }
1406 }
1407 }