mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-13 03:21:50 +00:00
Added server setting for agent core dump.
This commit is contained in:
parent
779540b42a
commit
a97907ffbd
5 changed files with 3506 additions and 47 deletions
|
@ -958,6 +958,14 @@ function createMeshCore(agent) {
|
||||||
try { require(data.plugin).consoleaction(data, data.rights, data.sessionid, this); } catch (e) { throw e; }
|
try { require(data.plugin).consoleaction(data, data.rights, data.sessionid, this); } catch (e) { throw e; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'coredump':
|
||||||
|
if (data.value === true) {
|
||||||
|
// TODO: This replace() below is not ideal, would be better to remove the .exe at the end instead of replace.
|
||||||
|
process.coreDumpLocation = (process.platform == 'win32') ? (process.execPath.replace('.exe', '.dmp')) : (process.execPath + '.dmp');
|
||||||
|
} else if (data.value === false) {
|
||||||
|
process.coreDumpLocation = null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Unknown action, ignore it.
|
// Unknown action, ignore it.
|
||||||
break;
|
break;
|
||||||
|
@ -2261,16 +2269,13 @@ function createMeshCore(agent) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'coredump':
|
case 'coredump':
|
||||||
if (args['_'].length != 1)
|
if (args['_'].length != 1) {
|
||||||
{
|
|
||||||
response = "Proper usage: coredump on|off|status"; // Display usage
|
response = "Proper usage: coredump on|off|status"; // Display usage
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (args['_'][0].toLowerCase())
|
switch (args['_'][0].toLowerCase())
|
||||||
{
|
{
|
||||||
case 'on':
|
case 'on':
|
||||||
process.coreDumpLocation = process.platform == 'win32' ? (process.execPath.replace('.exe', '.dmp')) : (process.execPath + '.dmp');
|
process.coreDumpLocation = (process.platform == 'win32') ? (process.execPath.replace('.exe', '.dmp')) : (process.execPath + '.dmp');
|
||||||
response = 'coredump is now on';
|
response = 'coredump is now on';
|
||||||
break;
|
break;
|
||||||
case 'off':
|
case 'off':
|
||||||
|
@ -2278,7 +2283,7 @@ function createMeshCore(agent) {
|
||||||
response = 'coredump is now off';
|
response = 'coredump is now off';
|
||||||
break;
|
break;
|
||||||
case 'status':
|
case 'status':
|
||||||
response = 'coredump is: ' + (process.coreDumpLocation == null ? 'off' : 'on');
|
response = 'coredump is: ' + ((process.coreDumpLocation == null) ? 'off' : 'on');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
response = "Proper usage: coredump on|off|status"; // Display usage
|
response = "Proper usage: coredump on|off|status"; // Display usage
|
||||||
|
@ -2789,34 +2794,6 @@ function createMeshCore(agent) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'dump':
|
|
||||||
if (args['_'].length < 1) {
|
|
||||||
response = 'Proper usage: dump [on/off/status]'; // Display correct command usage
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch (args['_'][0].toLowerCase()) {
|
|
||||||
case 'on':
|
|
||||||
process.coreDumpLocation = process.platform == 'win32' ? process.execPath.replace('.exe', '.dmp') : (process.execPath + '.dmp');
|
|
||||||
response = 'enabled';
|
|
||||||
break;
|
|
||||||
case 'off':
|
|
||||||
process.coreDumpLocation = null;
|
|
||||||
response = 'disabled';
|
|
||||||
break;
|
|
||||||
case 'status':
|
|
||||||
if (process.coreDumpLocation) {
|
|
||||||
response = 'Core Dump: [ENABLED' + (require('fs').existsSync(process.coreDumpLocation) ? (', (DMP file exists)]') : (']'));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
response = 'Core Dump: [DISABLED]';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
response = 'Proper usage: dump [on/off/status]'; // Display correct command usage
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'eval': { // Eval JavaScript
|
case 'eval': { // Eval JavaScript
|
||||||
if (args['_'].length < 1) {
|
if (args['_'].length < 1) {
|
||||||
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
||||||
|
|
3474
agents/meshcore.txt
Normal file
3474
agents/meshcore.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -975,6 +975,11 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
if ((results != null) && (results.length == 1)) { obj.send(JSON.stringify({ action: 'sysinfo', hash: results[0].hash })); } else { obj.send(JSON.stringify({ action: 'sysinfo' })); }
|
if ((results != null) && (results.length == 1)) { obj.send(JSON.stringify({ action: 'sysinfo', hash: results[0].hash })); } else { obj.send(JSON.stringify({ action: 'sysinfo' })); }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set agent core dump
|
||||||
|
if ((parent.parent.config.settings.agentcoredump === true) || (parent.parent.config.settings.agentcoredump === false)) {
|
||||||
|
obj.send(JSON.stringify({ action: 'coredump', value: parent.parent.config.settings.agentcoredump }));
|
||||||
|
}
|
||||||
|
|
||||||
// Do this if IP location is enabled on this domain TODO: Set IP location per device group?
|
// Do this if IP location is enabled on this domain TODO: Set IP location per device group?
|
||||||
if (domain.iplocation == true) {
|
if (domain.iplocation == true) {
|
||||||
// Check if we already have IP location information for this node
|
// Check if we already have IP location information for this node
|
||||||
|
@ -1270,7 +1275,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
parent.parent.DispatchEvent(parent.CreateMeshDispatchTargets(obj.dbMeshKey, [obj.dbNodeKey]), obj, event);
|
parent.parent.DispatchEvent(parent.CreateMeshDispatchTargets(obj.dbMeshKey, [obj.dbNodeKey]), obj, event);
|
||||||
|
|
||||||
// Update the device Intel AMT information
|
// Update the device Intel AMT information
|
||||||
ChangeAgentCoreInfo({ "intelamt": { user: 'admin', pass: amtpassword, uuid: command.uuid, realm: command.realm } });
|
ChangeAgentCoreInfo({ 'intelamt': { user: 'admin', pass: amtpassword, uuid: command.uuid, realm: command.realm } });
|
||||||
|
|
||||||
// Send the activation response
|
// Send the activation response
|
||||||
obj.send(JSON.stringify(signResponse));
|
obj.send(JSON.stringify(signResponse));
|
||||||
|
|
|
@ -12480,11 +12480,7 @@
|
||||||
"nl": "even wachten, reset e-mail verzonden.",
|
"nl": "even wachten, reset e-mail verzonden.",
|
||||||
"pt": "Aguarde, redefina o email enviado.",
|
"pt": "Aguarde, redefina o email enviado.",
|
||||||
"ru": "Подождите, письмо для сброса отправлено.",
|
"ru": "Подождите, письмо для сброса отправлено.",
|
||||||
"zh-chs": "稍等,重置已發送的郵件。",
|
"zh-chs": "稍等,重置已發送的郵件。"
|
||||||
"xloc": [
|
|
||||||
"login-mobile.handlebars->5->1",
|
|
||||||
"login.handlebars->5->1"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cs": "Drží se jeden záznam pro kopii",
|
"cs": "Drží se jeden záznam pro kopii",
|
||||||
|
@ -12871,6 +12867,13 @@
|
||||||
"default.handlebars->27->883"
|
"default.handlebars->27->883"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"en": "If valid, reset mail sent.",
|
||||||
|
"xloc": [
|
||||||
|
"login-mobile.handlebars->5->1",
|
||||||
|
"login.handlebars->5->1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cs": "Pokud jste tento požadavek nezačali, ignorujte tento e-mail.",
|
"cs": "Pokud jste tento požadavek nezačali, ignorujte tento e-mail.",
|
||||||
"de": "Wenn Sie diese Anfrage nicht initiiert haben, ignorieren Sie diese Mail bitte.",
|
"de": "Wenn Sie diese Anfrage nicht initiiert haben, ignorieren Sie diese Mail bitte.",
|
||||||
|
|
|
@ -6959,7 +6959,7 @@
|
||||||
for (var i in p) {
|
for (var i in p) {
|
||||||
if (p[i].p != 0) {
|
if (p[i].p != 0) {
|
||||||
var c = p[i].c;
|
var c = p[i].c;
|
||||||
if (c.length > 30) { c = '<span title="' + EscapeHtml(c) + '">' + EscapeHTML(c.substring(0,30)) + '...</span>' } else { c = EscapeHtml(c); }
|
if (c.length > 30) { c = '<span title="' + EscapeHtml(c) + '">' + EscapeHtml(c.substring(0,30)) + '...</span>' } else { c = EscapeHtml(c); }
|
||||||
x += '<div class=deskToolsBar><div style=width:50px;float:left;text-align:right;padding-right:5px>' + EscapeHtml(p[i].p) + '</div><a href=# style=float:right;padding-right:5px;cursor:pointer title="' + "Stop process" + '" onclick=\'return stopProcess(' + EscapeHtml(p[i].p) + ',"' + EscapeHtml(p[i].c) + '")\'><img width=10 height=10 src="images/trash.png"></a><div style=float:right;padding-right:5px>' + (p[i].u ? EscapeHtml(p[i].u) : '') + '</div><div>' + c + '</div></div>';
|
x += '<div class=deskToolsBar><div style=width:50px;float:left;text-align:right;padding-right:5px>' + EscapeHtml(p[i].p) + '</div><a href=# style=float:right;padding-right:5px;cursor:pointer title="' + "Stop process" + '" onclick=\'return stopProcess(' + EscapeHtml(p[i].p) + ',"' + EscapeHtml(p[i].c) + '")\'><img width=10 height=10 src="images/trash.png"></a><div style=float:right;padding-right:5px>' + (p[i].u ? EscapeHtml(p[i].u) : '') + '</div><div>' + c + '</div></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7555,7 +7555,7 @@
|
||||||
} else {
|
} else {
|
||||||
var link = shortname;
|
var link = shortname;
|
||||||
if (f.s > 0) { link = '<a href=# style=cursor:pointer onclick="return p13downloadfile(\'' + encodeURIComponentEx(newlinkpath + '/' + name) + '\',\'' + encodeURIComponentEx(name) + '\',' + f.s + ')">' + shortname + '</a>'; }
|
if (f.s > 0) { link = '<a href=# style=cursor:pointer onclick="return p13downloadfile(\'' + encodeURIComponentEx(newlinkpath + '/' + name) + '\',\'' + encodeURIComponentEx(name) + '\',' + f.s + ')">' + shortname + '</a>'; }
|
||||||
h = '<div id=fileEntry cmenu=filesContextMenu fileIndex=' + i + ' class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value=\'' + f.nx + '\'> <span class=fsize>' + fdatestr + '</span><span style=float:right>' + EscapeHTML(fsize) + '</span><span><div class=fileIcon' + f.t + '></div>' + link + '</span></div>';
|
h = '<div id=fileEntry cmenu=filesContextMenu fileIndex=' + i + ' class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value=\'' + f.nx + '\'> <span class=fsize>' + fdatestr + '</span><span style=float:right>' + EscapeHtml(fsize) + '</span><span><div class=fileIcon' + f.t + '></div>' + link + '</span></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f.t < 3) { html1 += h; } else { html2 += h; }
|
if (f.t < 3) { html1 += h; } else { html2 += h; }
|
||||||
|
|
Loading…
Reference in a new issue