seperate intel amt + amt cira in serverstats and monitoring #6549

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458
2025-03-25 19:42:50 +00:00
parent 23bee3b987
commit 36b5af7ad4
6 changed files with 313 additions and 253 deletions

View File

@@ -33,7 +33,8 @@ module.exports.CreateMonitoring = function (parent, args) {
blockedAgents: { description: "Blocked Agents" }, // blockedAgents
};
obj.gaugeMetrics = { // Gauge Metrics always start at 0 and can increase and decrease
ConnectedIntelAMT: { description: "Connected Intel AMT" }, // parent.mpsserver.ciraConnections[i].length
ConnectedIntelAMT: { description: "Connected Intel AMT" }, // parent.parent.connectivityByNode[i].connectivity == 4
ConnectedIntelAMTCira: { description: "Connected Intel AMT CIRA" }, // parent.mpsserver.ciraConnections[i].length
UserAccounts: { description: "User Accounts" }, // Object.keys(parent.webserver.users).length
DeviceGroups: { description: "Device Groups" }, // parent.webserver.meshes (ONLY WHERE deleted=null)
AgentSessions: { description: "Agent Sessions" }, // Object.keys(parent.webserver.wsagents).length
@@ -79,10 +80,14 @@ module.exports.CreateMonitoring = function (parent, args) {
ConnectedIntelAMT: 0
};
if (parent.mpsserver != null) {
gauges.ConnectedIntelAMTCira = 0;
for (var i in parent.mpsserver.ciraConnections) {
gauges.ConnectedIntelAMT += parent.mpsserver.ciraConnections[i].length;
gauges.ConnectedIntelAMTCira += parent.mpsserver.ciraConnections[i].length;
}
}
for (var i in parent.connectivityByNode) {
if (parent.connectivityByNode[i].connectivity == 4) { gauges.ConnectedIntelAMT++; }
}
for (const key in gauges) { obj.gaugeMetrics[key].prometheus.set(gauges[key]); }
// Take a look at agent errors
var agentstats = parent.webserver.getAgentStats();