From 5d57c71e2e1b102ac5698802366b11028037bc8f Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 28 May 2019 12:08:09 -0700 Subject: [PATCH] Added agent TCP close tracking. --- meshagent.js | 5 ++++- webserver.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/meshagent.js b/meshagent.js index c1820382..6c3163a9 100644 --- a/meshagent.js +++ b/meshagent.js @@ -477,7 +477,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { } obj.close(0); }); - // ws._socket._parent.on('close', function (req) { if (obj.nodeid != null) { parent.parent.debug(1, 'Agent TCP disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } }); + ws._socket._parent.on('close', function (req) { + parent.agentStats.agentTcpClose++; + //if (obj.nodeid != null) { parent.parent.debug(1, 'Agent TCP disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } + }); // Start authenticate the mesh agent by sending a auth nonce & server TLS cert hash. // Send 384 bits SHA384 hash of TLS cert public key + 384 bits nonce diff --git a/webserver.js b/webserver.js index fb9489c7..228440f8 100644 --- a/webserver.js +++ b/webserver.js @@ -242,6 +242,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { obj.agentStats = { createMeshAgentCount: 0, agentClose: 0, + agentTcpClose: 0, agentBinaryUpdate: 0, coreIsStableCount: 0, verifiedAgentConnectionCount: 0,