1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added AgentIssues command to server console.

This commit is contained in:
Ylian Saint-Hilaire 2021-02-03 15:36:25 -08:00
parent e2b7d38bc8
commit 45e3b8efed
3 changed files with 29 additions and 1 deletions

View file

@ -308,6 +308,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
createMeshAgentCount: 0,
agentClose: 0,
agentBinaryUpdate: 0,
agentMeshCoreBinaryUpdate: 0,
coreIsStableCount: 0,
verifiedAgentConnectionCount: 0,
clearingCoreCount: 0,
@ -331,6 +332,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
}
obj.getAgentStats = function () { return obj.agentStats; }
// Keep a record of the last agent issues.
obj.getAgentIssues = function () { return obj.agentIssues; }
obj.setAgentIssue = function (agent, issue) { obj.agentIssues.push([new Date().toLocaleTimeString(), agent.remoteaddrport, issue]); while (obj.setAgentIssue.length > 50) { obj.agentIssues.shift(); } }
obj.agentIssues = [];
// Authenticate the user
obj.authenticate = function (name, pass, domain, fn) {
if ((typeof (name) != 'string') || (typeof (pass) != 'string') || (typeof (domain) != 'object')) { fn(new Error('invalid fields')); return; }