mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-23 11:32:28 -05:00
Fix gauge typo (#6778)
This commit is contained in:
parent
f2681de87d
commit
4b621a01fb
@ -32,7 +32,7 @@ module.exports.CreateMonitoring = function (parent, args) {
|
|||||||
blockedUsers: { description: "Blocked Users" }, // blockedUsers
|
blockedUsers: { description: "Blocked Users" }, // blockedUsers
|
||||||
blockedAgents: { description: "Blocked Agents" }, // blockedAgents
|
blockedAgents: { description: "Blocked Agents" }, // blockedAgents
|
||||||
};
|
};
|
||||||
obj.guageMetrics = { // Guage Metrics always start at 0 and can increase and decrease
|
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.mpsserver.ciraConnections[i].length
|
||||||
UserAccounts: { description: "User Accounts" }, // Object.keys(parent.webserver.users).length
|
UserAccounts: { description: "User Accounts" }, // Object.keys(parent.webserver.users).length
|
||||||
DeviceGroups: { description: "Device Groups" }, // parent.webserver.meshes (ONLY WHERE deleted=null)
|
DeviceGroups: { description: "Device Groups" }, // parent.webserver.meshes (ONLY WHERE deleted=null)
|
||||||
@ -51,8 +51,8 @@ module.exports.CreateMonitoring = function (parent, args) {
|
|||||||
obj.prometheus = require('prom-client');
|
obj.prometheus = require('prom-client');
|
||||||
const collectDefaultMetrics = obj.prometheus.collectDefaultMetrics;
|
const collectDefaultMetrics = obj.prometheus.collectDefaultMetrics;
|
||||||
collectDefaultMetrics();
|
collectDefaultMetrics();
|
||||||
for (const key in obj.guageMetrics) {
|
for (const key in obj.gaugeMetrics) {
|
||||||
obj.guageMetrics[key].prometheus = new obj.prometheus.Gauge({ name: 'meshcentral_' + String(key).toLowerCase(), help: obj.guageMetrics[key].description });
|
obj.gaugeMetrics[key].prometheus = new obj.prometheus.Gauge({ name: 'meshcentral_' + String(key).toLowerCase(), help: obj.gaugeMetrics[key].description });
|
||||||
}
|
}
|
||||||
for (const key in obj.counterMetrics) {
|
for (const key in obj.counterMetrics) {
|
||||||
obj.counterMetrics[key].prometheus = new obj.prometheus.Counter({ name: 'meshcentral_' + String(key).toLowerCase(), help: obj.counterMetrics[key].description });
|
obj.counterMetrics[key].prometheus = new obj.prometheus.Counter({ name: 'meshcentral_' + String(key).toLowerCase(), help: obj.counterMetrics[key].description });
|
||||||
@ -67,7 +67,7 @@ module.exports.CreateMonitoring = function (parent, args) {
|
|||||||
// Count the number of device groups that are not deleted
|
// Count the number of device groups that are not deleted
|
||||||
var activeDeviceGroups = 0;
|
var activeDeviceGroups = 0;
|
||||||
for (var i in parent.webserver.meshes) { if (parent.webserver.meshes[i].deleted == null) { activeDeviceGroups++; } } // This is not ideal for performance, we want to dome something better.
|
for (var i in parent.webserver.meshes) { if (parent.webserver.meshes[i].deleted == null) { activeDeviceGroups++; } } // This is not ideal for performance, we want to dome something better.
|
||||||
var guages = {
|
var gauges = {
|
||||||
UserAccounts: Object.keys(parent.webserver.users).length,
|
UserAccounts: Object.keys(parent.webserver.users).length,
|
||||||
DeviceGroups: activeDeviceGroups,
|
DeviceGroups: activeDeviceGroups,
|
||||||
AgentSessions: Object.keys(parent.webserver.wsagents).length,
|
AgentSessions: Object.keys(parent.webserver.wsagents).length,
|
||||||
@ -79,10 +79,10 @@ module.exports.CreateMonitoring = function (parent, args) {
|
|||||||
};
|
};
|
||||||
if (parent.mpsserver != null) {
|
if (parent.mpsserver != null) {
|
||||||
for (var i in parent.mpsserver.ciraConnections) {
|
for (var i in parent.mpsserver.ciraConnections) {
|
||||||
guages.ConnectedIntelAMT += parent.mpsserver.ciraConnections[i].length;
|
gauges.ConnectedIntelAMT += parent.mpsserver.ciraConnections[i].length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const key in guages) { obj.guageMetrics[key].prometheus.set(guages[key]); }
|
for (const key in gauges) { obj.gaugeMetrics[key].prometheus.set(gauges[key]); }
|
||||||
// Take a look at agent errors
|
// Take a look at agent errors
|
||||||
var agentstats = parent.webserver.getAgentStats();
|
var agentstats = parent.webserver.getAgentStats();
|
||||||
const counters = {
|
const counters = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user