From 0b3799838b9fa6f30e15f13c975cd70aada0fc40 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 6 Oct 2021 13:11:40 -0700 Subject: [PATCH] 1. Added instrumentation 2. Fixed bug with amtuuid when specifying remote host --- agents/meshcmd.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index cb238b4b..5b18623a 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -166,6 +166,7 @@ function run(argv) { if (args.json) { settings.json = true; } if (args.tls) { settings.tls = true; } if ((argv.length > 1) && (actions.indexOf(argv[1].toUpperCase()) >= 0)) { settings.action = argv[1]; } + if (globalDebugFlags != 0) { console.setInfoLevel(1); } // Validate meshaction.txt if (settings.action == null) { @@ -1394,13 +1395,13 @@ function getTrustedHashes(amtMei, func, tag) { // // Called to get the UUID of Intel AMT, start by setting up MicroLMS if we are doing the operation on the local computer -function getAmtUuid() { - if (settings.hostname == null) { - var amtMeiModule, amtMei; - try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { console.log(ex); exit(1); return; } - amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; }); - amtMei.getUuid(function (result) { if ((result == null) || (result.uuid == null)) { console.log('Failed.'); } else { console.log(result.uuid); } exit(1); }); - } else { +function getAmtUuid() +{ + if (settings.hostname != null) + { + getAmtUuidEx(); + } else + { if ((settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) { settings.noconsole = true; startLms(getAmtUuidEx); return; } else { getAmtUuidEx(); } } }