diff --git a/agents/meshcore.js b/agents/meshcore.js index d68fc305..eb907df1 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -822,6 +822,7 @@ function createMeshCore(agent) sendConsoleText('getScript: ' + JSON.stringify(data)); break; } + /* case 'sysinfo': { // Fetch system information if (process.platform != 'win32') break; // Remove this when Linux/MacOS support this. @@ -837,7 +838,6 @@ function createMeshCore(agent) try { delete x.TotalVirtualMemorySize; } catch (ex) { } try { delete x.TotalVisibleMemorySize; } catch (ex) { } } - /* if (process.platform == 'win32') { var defragResult = function (r) @@ -857,18 +857,18 @@ function createMeshCore(agent) if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); } } } - var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag + var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag TODO pr.callname = 'defrag'; pr.sessionid = data.sessionid; pr.then(defragResult, defragResult); } else { - */ - results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex'); - if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); } - //} + results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex'); + if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); } + } } catch (ex) { } break; } + */ case 'ping': { mesh.SendCommand('{"action":"pong"}'); break; } case 'pong': { break; } default: @@ -1650,7 +1650,7 @@ function createMeshCore(agent) var response = null; switch (cmd) { case 'help': { // Displays available commands - response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av, cpuinfo, sysinfo.'; + response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av.'; // cpuinfo, sysinfo break; } /* @@ -1814,6 +1814,7 @@ function createMeshCore(agent) } break; } + /* case 'cpuinfo': { // Return system information // CPU & memory utilization pr = require('sysinfo').cpuUtilization(); @@ -1849,6 +1850,7 @@ function createMeshCore(agent) } break; } + */ case 'info': { // Return information about the agent and agent core module response = 'Current Core: ' + meshCoreObj.value + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform: ' + process.platform + '.\r\nCapabilities: ' + meshCoreObj.caps + '.\r\nServer URL: ' + mesh.ServerUrl + '.'; if (amt != null) { response += '\r\nBuilt-in LMS: ' + ['Disabled', 'Connecting..', 'Connected'][amt.lmsstate] + '.'; } diff --git a/agents/meshcore.min.js b/agents/meshcore.min.js index d68fc305..eb907df1 100644 --- a/agents/meshcore.min.js +++ b/agents/meshcore.min.js @@ -822,6 +822,7 @@ function createMeshCore(agent) sendConsoleText('getScript: ' + JSON.stringify(data)); break; } + /* case 'sysinfo': { // Fetch system information if (process.platform != 'win32') break; // Remove this when Linux/MacOS support this. @@ -837,7 +838,6 @@ function createMeshCore(agent) try { delete x.TotalVirtualMemorySize; } catch (ex) { } try { delete x.TotalVisibleMemorySize; } catch (ex) { } } - /* if (process.platform == 'win32') { var defragResult = function (r) @@ -857,18 +857,18 @@ function createMeshCore(agent) if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); } } } - var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag + var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag TODO pr.callname = 'defrag'; pr.sessionid = data.sessionid; pr.then(defragResult, defragResult); } else { - */ - results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex'); - if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); } - //} + results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex'); + if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); } + } } catch (ex) { } break; } + */ case 'ping': { mesh.SendCommand('{"action":"pong"}'); break; } case 'pong': { break; } default: @@ -1650,7 +1650,7 @@ function createMeshCore(agent) var response = null; switch (cmd) { case 'help': { // Displays available commands - response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av, cpuinfo, sysinfo.'; + response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av.'; // cpuinfo, sysinfo break; } /* @@ -1814,6 +1814,7 @@ function createMeshCore(agent) } break; } + /* case 'cpuinfo': { // Return system information // CPU & memory utilization pr = require('sysinfo').cpuUtilization(); @@ -1849,6 +1850,7 @@ function createMeshCore(agent) } break; } + */ case 'info': { // Return information about the agent and agent core module response = 'Current Core: ' + meshCoreObj.value + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform: ' + process.platform + '.\r\nCapabilities: ' + meshCoreObj.caps + '.\r\nServer URL: ' + mesh.ServerUrl + '.'; if (amt != null) { response += '\r\nBuilt-in LMS: ' + ['Disabled', 'Connecting..', 'Connected'][amt.lmsstate] + '.'; } diff --git a/meshagent.js b/meshagent.js index 50815893..baf10701 100644 --- a/meshagent.js +++ b/meshagent.js @@ -911,9 +911,11 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { } // Fetch system information + /* db.GetHash('si' + obj.dbNodeKey, function (err, results) { if ((results != null) && (results.length == 1)) { obj.send(JSON.stringify({ action: 'sysinfo', hash: results[0].hash })); } else { obj.send(JSON.stringify({ action: 'sysinfo' })); } }); + */ // Do this if IP location is enabled on this domain TODO: Set IP location per device group? if (domain.iplocation == true) { @@ -1304,6 +1306,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { } break; } + /* case 'sysinfo': { //console.log('sysinfo', obj.nodeid, JSON.stringify(command.data.hash)); command.data._id = 'si' + obj.dbNodeKey; @@ -1317,6 +1320,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { }); break; } + */ default: { parent.agentStats.unknownAgentActionCount++; console.log('Unknown agent action (' + obj.remoteaddrport + '): ' + command.action + '.'); diff --git a/package.json b/package.json index 001441e0..2ae91e78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.9-h", + "version": "0.3.9-i", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default-min.handlebars b/views/default-min.handlebars index f43a9fc3..e658cd75 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -1 +1 @@ -
{{{logoutControl}}}
My Devices | My Account | My Events | My Files | My Users | My Server |
{{{logoutControl}}}
My Devices | My Account | My Events | My Files | My Users | My Server |