diff --git a/docs/Using Fleet/Usage-statistics.md b/docs/Using Fleet/Usage-statistics.md index 1f34ce9074..0e6628601d 100644 --- a/docs/Using Fleet/Usage-statistics.md +++ b/docs/Using Fleet/Usage-statistics.md @@ -21,6 +21,10 @@ Below is the JSON payload that is sent to Fleet Device Management Inc: "vulnDetectionEnabled": true, "systemUsersEnabled": true, "hostsStatusWebHookEnabled": true, + "mdmMacOsEnabled": true, + "hostExpiryEnabled": true, + "mdmWindowsEnabled": false, + "liveQueryDisabled": false, "numWeeklyActiveUsers": 999, "numWeeklyPolicyViolationDaysActual": 999, "numWeeklyPolicyViolationDaysPossible": 999, diff --git a/website/api/controllers/webhooks/receive-usage-analytics.js b/website/api/controllers/webhooks/receive-usage-analytics.js index 699baa2f8c..eaada1fd8e 100644 --- a/website/api/controllers/webhooks/receive-usage-analytics.js +++ b/website/api/controllers/webhooks/receive-usage-analytics.js @@ -29,6 +29,10 @@ module.exports = { storedErrors: { type: [{}], defaultsTo: [] }, // TODO migrate all rows that have "[]" to {} numHostsNotResponding: { type: 'number', defaultsTo: 0, description: 'The number of hosts per deployment that have not submitted results for distibuted queries. A host is counted as not responding if Fleet hasn\'t received a distributed write to requested distibuted queries for the host during the 2-hour interval since the host was last seen. Hosts that have not been seen for 7 days or more are not counted.', }, organization: { type: 'string', defaultsTo: 'unknown', description: 'For Fleet Premium deployments, the organization registered with the license.', }, + mdmMacOsEnabled: {type: 'boolean', defaultsTo: false}, + mdmWindowsEnabled: {type: 'boolean', defaultsTo: false}, + liveQueryDisabled: {type: 'boolean', defaultsTo: false}, + hostExpiryEnabled: {type: 'boolean', defaultsTo: false}, }, @@ -54,6 +58,10 @@ module.exports = { `vuln_detection_enabled:${inputs.vulnDetectionEnabled}`, `system_users_enabled:${inputs.systemUsersEnabled}`, `host_status_webhook_enabled:${inputs.hostsStatusWebHookEnabled}`, + `mdm_macos_enabled:${inputs.mdmMacOsEnabled}`, + `mdm_windows_enabled:${inputs.mdmWindowsEnabled}`, + `live_query_disabled:${inputs.liveQueryDisabled}`, + `host_expiry_enabled:${inputs.hostExpiryEnabled}`, ]; // Create a timestamp in seconds for these metrics diff --git a/website/api/models/HistoricalUsageSnapshot.js b/website/api/models/HistoricalUsageSnapshot.js index d101b66150..2263304c0b 100644 --- a/website/api/models/HistoricalUsageSnapshot.js +++ b/website/api/models/HistoricalUsageSnapshot.js @@ -23,7 +23,7 @@ module.exports = { softwareInventoryEnabled: { required: true, type: 'boolean' }, vulnDetectionEnabled: { required: true, type: 'boolean' }, systemUsersEnabled: { required: true, type: 'boolean' }, - hostsStatusWebHookEnabled: { required: true, type: 'boolean', columnName: 'hostStatusWebhookEnabled'},// Note: We are specifying a columnName for this attribute to avoid migrating the exsiting records when the name of this attribute was changed. FUTURE: Next time we add attributes to this model, change the column name in the database and remove the columnName from this attribute. + hostsStatusWebHookEnabled: { required: true, type: 'boolean'}, numWeeklyActiveUsers: { required: true, type: 'number' }, numWeeklyPolicyViolationDaysActual: { required: true, type: 'number' }, numWeeklyPolicyViolationDaysPossible: { required: true, type: 'number'}, @@ -33,6 +33,10 @@ module.exports = { storedErrors: { required: true, type: 'json' }, numHostsNotResponding: { required: true, type: 'number', description: 'The number of hosts per deployment that have not submitted results for distibuted queries. A host is counted as not responding if Fleet hasn\'t received a distributed write to requested distibuted queries for the host during the 2-hour interval since the host was last seen. Hosts that have not been seen for 7 days or more are not counted.', }, organization: { required: true, type: 'string' }, + mdmMacOsEnabled: {required: true, type: 'boolean'}, + mdmWindowsEnabled: {required: true, type: 'boolean'}, + liveQueryDisabled: {required: true, type: 'boolean'}, + hostExpiryEnabled: {required: true, type: 'boolean'}, // ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗ // ║╣ ║║║╠╩╗║╣ ║║╚═╗