From 03ac2120be2c53cccaf8b1523fb3fad283de1263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Thu, 24 Oct 2024 11:02:52 +0000 Subject: [PATCH 1/4] fix(license-release): Allow empty arrays for never-release users, custom properties etc Fixes #1287 --- .gitignore | 4 ++++ .vscode/launch.json | 1 + src/butler.js | 1 - src/globals.js | 5 +++-- src/lib/qseow/qliksense_license.js | 21 +++++++++++---------- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index fdfa09ea..0922dcfb 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,7 @@ src/config/butler-config.yaml src/udp_client/udp-client.exe src/config/production_empty_arrays.yaml src/config/production_template_filledin.yaml +build.cjs +butler +sea-config.json +sea-prep.blob diff --git a/.vscode/launch.json b/.vscode/launch.json index 38de8bdd..7f028041 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,6 +11,7 @@ "program": "${workspaceFolder}/src/butler.js", // "runtimeVersion": "20", "runtimeVersion": "18", + // "runtimeVersion": "23", "cwd": "${workspaceFolder}/src", "env": { "NODE_CONFIG_DIR": "${workspaceFolder}/src/config", diff --git a/src/butler.js b/src/butler.js index 65644718..218a7c1e 100644 --- a/src/butler.js +++ b/src/butler.js @@ -1,4 +1,3 @@ -/* eslint-disable import/first */ // Add dependencies import dgram from 'dgram'; diff --git a/src/globals.js b/src/globals.js index 27970431..d0dde51f 100644 --- a/src/globals.js +++ b/src/globals.js @@ -96,6 +96,7 @@ class Settings { program.parse(process.argv); this.options = program.opts(); + // Utility functions this.checkFileExistsSync = Settings.checkFileExistsSync; this.sleep = Settings.sleep; @@ -274,7 +275,7 @@ class Settings { this.logger.debug('CONFIG: API doc mode=off'); // Deep copy of headers object const httpHeadersEngine = JSON.parse(JSON.stringify(this.config.get('Butler.configEngine.headers'))); - + // Engine config this.configEngine = { engineVersion: this.config.get('Butler.configEngine.engineVersion'), @@ -289,7 +290,7 @@ class Settings { // Deep copy of headers object const httpHeadersQRS = JSON.parse(JSON.stringify(this.config.get('Butler.configQRS.headers'))); - + // QRS config this.configQRS = { authentication: this.config.get('Butler.configQRS.authentication'), diff --git a/src/lib/qseow/qliksense_license.js b/src/lib/qseow/qliksense_license.js index e59b2aaf..0e6a2746 100644 --- a/src/lib/qseow/qliksense_license.js +++ b/src/lib/qseow/qliksense_license.js @@ -616,13 +616,14 @@ async function licenseReleaseAnalyzer(config, logger, qrsInstance) { let doNotRelease = false; let doNotReleaseReason = ''; - // Check do-not-release user names - // eslint-disable-next-line no-restricted-syntax - for (const user of neverReleaseUsers) { - if (license.user.userDirectory === user.userDir && license.user.userId === user.userId) { - doNotRelease = true; - doNotReleaseReason = 'User is in the neverRelease.user list'; - break; + // Check do-not-release user names if there are any + if (neverReleaseUsers?.length > 0) { + for (const user of neverReleaseUsers) { + if (license.user.userDirectory === user.userDir && license.user.userId === user.userId) { + doNotRelease = true; + doNotReleaseReason = 'User is in the neverRelease.user list'; + break; + } } } @@ -630,7 +631,7 @@ async function licenseReleaseAnalyzer(config, logger, qrsInstance) { // If... // - the user is not already marked as doNotRelease=true and // - the currentUser does not haven any neverReleaseTags set - if (!doNotRelease) { + if (!doNotRelease && currentUser.tags?.length > 0) { // Check if the user has any of the neverReleaseTags set // currentUser.tags is an array of tag objects. Each object has properties id and name // eslint-disable-next-line no-restricted-syntax @@ -653,7 +654,7 @@ async function licenseReleaseAnalyzer(config, logger, qrsInstance) { // If... // - the user is not already marked as doNotRelease=true and // - the currentUser does not have any neverReleaseCustomProperties set - if (!doNotRelease) { + if (!doNotRelease && currentUser.customProperties?.length > 0) { // currentUser.customProperties is an array of custom property objects. // Each object looks like this: // { @@ -688,7 +689,7 @@ async function licenseReleaseAnalyzer(config, logger, qrsInstance) { // If... // - the user is not already marked as doNotRelease=true and // - the currentUser does not have any neverReleaseUserDirectories set - if (!doNotRelease) { + if (!doNotRelease && neverReleaseUserDirectories?.length > 0) { // eslint-disable-next-line no-restricted-syntax for (const neverReleaseUserDir of neverReleaseUserDirectories) { if (license.user.userDirectory === neverReleaseUserDir) { From 82a2c7cf847384c39c9b7fc1b354f2b4174e5bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Thu, 24 Oct 2024 11:03:09 +0000 Subject: [PATCH 2/4] chore(deps): Updated dependencies --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 6 +++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8742bf23..5e37194e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,15 +65,15 @@ "xstate": "^5.18.2" }, "devDependencies": { - "@babel/eslint-parser": "^7.25.8", - "@babel/plugin-syntax-import-assertions": "^7.25.7", + "@babel/eslint-parser": "^7.25.9", + "@babel/plugin-syntax-import-assertions": "^7.25.9", "@eslint/js": "^9.13.0", "esbuild": "^0.24.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", "prettier": "^3.3.3", - "snyk": "^1.1293.1" + "snyk": "^1.1294.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -215,9 +215,9 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.25.8.tgz", - "integrity": "sha512-Po3VLMN7fJtv0nsOjBDSbO1J71UhzShE9MuOSkWEV9IZQXzhZklYtzKZ8ZD/Ij3a0JBv1AG3Ny2L3jvAHQVOGg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.25.9.tgz", + "integrity": "sha512-5UXfgpK0j0Xr/xIdgdLEhOFxaDZ0bRPWJJchRpqOSur/3rZoPbqqki5mm0p4NE2cs28krBEiSM2MB7//afRSQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -335,9 +335,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", - "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, "license": "MIT", "engines": { @@ -537,13 +537,13 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.7.tgz", - "integrity": "sha512-ZvZQRmME0zfJnDQnVBKYzHxXT7lYBB3Revz1GuS7oLXWMgqUPX4G+DDbT30ICClht9WKV34QVrZhSw6WdklwZQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.9.tgz", + "integrity": "sha512-4GHX5uzr5QMOOuzV0an9MFju4hKlm0OyePl/lHhcsTVae5t/IKVHnb8W67Vr6FuLlk5lPqLB7n7O+K5R46emYg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -9087,9 +9087,9 @@ } }, "node_modules/snyk": { - "version": "1.1293.1", - "resolved": "https://registry.npmjs.org/snyk/-/snyk-1.1293.1.tgz", - "integrity": "sha512-CnbNrsEUMGfajfJ5/03BIgx1ixWKr9Kk+9xDw6sZqKy4K5K01DkyUp/V+WjbCfjr0li9+aE7u70s276KEOuiNA==", + "version": "1.1294.0", + "resolved": "https://registry.npmjs.org/snyk/-/snyk-1.1294.0.tgz", + "integrity": "sha512-4RBj3Lfccz5+6L2Kw9bt7icF+ex3antwt9PkSl2oEulI7mgqvc8VUFLnezg8c6PY60IPM9DrSSmNjXBac10I3Q==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", diff --git a/package.json b/package.json index aa5b0497..31c4e400 100644 --- a/package.json +++ b/package.json @@ -105,15 +105,15 @@ "xstate": "^5.18.2" }, "devDependencies": { - "@babel/eslint-parser": "^7.25.8", - "@babel/plugin-syntax-import-assertions": "^7.25.7", + "@babel/eslint-parser": "^7.25.9", + "@babel/plugin-syntax-import-assertions": "^7.25.9", "@eslint/js": "^9.13.0", "esbuild": "^0.24.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", "prettier": "^3.3.3", - "snyk": "^1.1293.1" + "snyk": "^1.1294.0" }, "pkg": { "assets": [ From 56663dabb1f0ba8ec06161d8243b8263c9caf99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Thu, 24 Oct 2024 11:08:45 +0000 Subject: [PATCH 3/4] fix(logs): Clearer logging when sending data to InfluxDB Fixes #1288 --- src/lib/post_to_influxdb.js | 70 ++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/src/lib/post_to_influxdb.js b/src/lib/post_to_influxdb.js index 7262cec5..c3537008 100755 --- a/src/lib/post_to_influxdb.js +++ b/src/lib/post_to_influxdb.js @@ -40,14 +40,14 @@ export function postButlerMemoryUsageToInfluxdb(memory) { .then(() => { globals.logger.silly( - `INFLUXDB MEMORY USAGE: Influxdb datapoint for Butler INFLUXDB MEMORY USAGE: ${JSON.stringify(datapoint, null, 2)}`, + `MEMORY USAGE: Influxdb datapoint for Butler INFLUXDB MEMORY USAGE: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.verbose('INFLUXDB MEMORY USAGE: Sent Butler memory usage data to InfluxDB'); + globals.logger.verbose('MEMORY USAGE: Sent Butler memory usage data to InfluxDB'); }) .catch((err) => { - globals.logger.error(`INFLUXDB MEMORY USAGE: Error saving Butler memory usage to InfluxDB! ${err.stack}`); + globals.logger.error(`MEMORY USAGE: Error saving Butler memory usage to InfluxDB! ${err.stack}`); }); } @@ -65,7 +65,7 @@ export function postButlerMemoryUsageToInfluxdb(memory) { // copyrightYearRange: "1993-2024", // } export async function postQlikSenseVersionToInfluxDB(qlikSenseVersion) { - globals.logger.verbose('[QSEOW] INFLUXDB QLIK SENSE VERSION: Sending Qlik Sense version to InfluxDB'); + globals.logger.verbose('[QSEOW] QLIK SENSE VERSION: Sending Qlik Sense version to InfluxDB'); // Get tags from config file // Stored in array Butler.qlikSenseVersion.versionMonitor.destination.influxDb.tag @@ -119,11 +119,11 @@ export async function postQlikSenseVersionToInfluxDB(qlikSenseVersion) { await globals.influx.writePoints(deepClonedDatapoint); globals.logger.silly( - `[QSEOW] INFLUXDB QLIK SENSE VERSION: Influxdb datapoint for Qlik Sense version: ${JSON.stringify(datapoint, null, 2)}`, + `[QSEOW] QLIK SENSE VERSION: Influxdb datapoint for Qlik Sense version: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.verbose('[QSEOW] INFLUXDB QLIK SENSE VERSION: Sent Qlik Sense version to InfluxDB'); + globals.logger.verbose('[QSEOW] QLIK SENSE VERSION: Sent Qlik Sense version to InfluxDB'); } // Function to store Qlik Sense server license status to InfluxDB @@ -135,7 +135,7 @@ export async function postQlikSenseVersionToInfluxDB(qlikSenseVersion) { // "daysUntilExpiry": , // } export async function postQlikSenseServerLicenseStatusToInfluxDB(qlikSenseServerLicenseStatus) { - globals.logger.verbose('[QSEOW] INFLUXDB QLIK SENSE SERVER LICENSE STATUS: Sending Qlik Sense server license status to InfluxDB'); + globals.logger.verbose('[QSEOW] QLIK SENSE SERVER LICENSE STATUS: Sending Qlik Sense server license status to InfluxDB'); // Get tags from config file // Stored in array Butler.qlikSenseLicense.serverLicenseMonitor.destination.influxDb.tag @@ -184,7 +184,7 @@ export async function postQlikSenseServerLicenseStatusToInfluxDB(qlikSenseServer await globals.influx.writePoints(deepClonedDatapoint); globals.logger.silly( - `[QSEOW] INFLUXDB QLIK SENSE SERVER LICENSE STATUS: Influxdb datapoint for Qlik Sense server license status: ${JSON.stringify( + `[QSEOW] QLIK SENSE SERVER LICENSE STATUS: Influxdb datapoint for Qlik Sense server license status: ${JSON.stringify( datapoint, null, 2, @@ -192,7 +192,7 @@ export async function postQlikSenseServerLicenseStatusToInfluxDB(qlikSenseServer ); datapoint = null; - globals.logger.verbose('[QSEOW] INFLUXDB QLIK SENSE SERVER LICENSE STATUS: Sent Qlik Sense server license status to InfluxDB'); + globals.logger.verbose('[QSEOW] QLIK SENSE SERVER LICENSE STATUS: Sent Qlik Sense server license status to InfluxDB'); } // Function to store Qlik Sense access license status to InfluxDB @@ -247,7 +247,7 @@ export async function postQlikSenseServerLicenseStatusToInfluxDB(qlikSenseServer // "schemaPath": "AccessTypeOverview" // } export async function postQlikSenseLicenseStatusToInfluxDB(qlikSenseLicenseStatus) { - globals.logger.verbose('[QSEOW] INFLUXDB QLIK SENSE LICENSE STATUS: Sending Qlik Sense license status to InfluxDB'); + globals.logger.verbose('[QSEOW] END USER ACCESS LICENSE: Sending Qlik Sense license status to InfluxDB'); // Get tags from config file // Stored in array Butler.qlikSenseLicense.licenseMonitor.destination.influxDb.tag @@ -398,16 +398,16 @@ export async function postQlikSenseLicenseStatusToInfluxDB(qlikSenseLicenseStatu await globals.influx.writePoints(deepClonedDatapoint); globals.logger.silly( - `[QSEOW] INFLUXDB QLIK SENSE LICENSE STATUS: Influxdb datapoint for Qlik Sense license status: ${JSON.stringify(datapoint, null, 2)}`, + `[QSEOW] END USER ACCESS LICENSE: Influxdb datapoint for Qlik Sense license status: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.info('[QSEOW] INFLUXDB QLIK SENSE LICENSE STATUS: Sent aggregated Qlik Sense license status to InfluxDB'); + globals.logger.info('[QSEOW] END USER ACCESS LICENSE: Sent aggregated Qlik Sense license status to InfluxDB'); } // Function to store info about released Qlik Sense licenses to InfluxDB export async function postQlikSenseLicenseReleasedToInfluxDB(licenseInfo) { - globals.logger.verbose('[QSEOW] INFLUXDB QLIK SENSE LICENSE RELEASE: Sending info on released Qlik Sense license to InfluxDB'); + globals.logger.verbose('[QSEOW] END USER ACCESS LICENSE RELEASE: Sending info on released Qlik Sense license to InfluxDB'); // Get tags from config file // Stored in array Butler.qlikSenseLicense.licenseMonitor.destination.influxDb.tag @@ -455,17 +455,17 @@ export async function postQlikSenseLicenseReleasedToInfluxDB(licenseInfo) { await globals.influx.writePoints(deepClonedDatapoint); globals.logger.silly( - `[QSEOW] INFLUXDB QLIK SENSE LICENSE RELEASE: Influxdb datapoint for released Qlik Sense license: ${JSON.stringify(datapoint, null, 2)}`, + `[QSEOW] END USER ACCESS LICENSE RELEASE: Influxdb datapoint for released Qlik Sense license: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.debug('[QSEOW] INFLUXDB QLIK SENSE LICENSE RELEASE: Sent info on released Qlik Sense license to InfluxDB'); + globals.logger.debug('[QSEOW] END USER ACCESS LICENSE RELEASE: Sent info on released Qlik Sense license to InfluxDB'); } // Function to store windows service status to InfluxDB export function postWindowsServiceStatusToInfluxDB(serviceStatus) { globals.logger.verbose( - `INFLUXDB WINDOWS SERVICE STATUS: Sending service status to InfluxDB: service="${serviceStatus.serviceFriendlyName}", status="${serviceStatus.serviceStatus}"`, + `WINDOWS SERVICE STATUS: Sending service status to InfluxDB: service="${serviceStatus.serviceFriendlyName}", status="${serviceStatus.serviceStatus}"`, ); // Create lookup table for Windows service state to numeric value, starting with 1 for stopped @@ -530,25 +530,21 @@ export function postWindowsServiceStatusToInfluxDB(serviceStatus) { .then(() => { globals.logger.silly( - `INFLUXDB WINDOWS SERVICE STATUS: Influxdb datapoint for INFLUXDB WINDOWS SERVICE STATUS: ${JSON.stringify( - datapoint, - null, - 2, - )}`, + `WINDOWS SERVICE STATUS: Influxdb datapoint for INFLUXDB WINDOWS SERVICE STATUS: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.verbose('INFLUXDB WINDOWS SERVICE STATUS: Sent Windows service status data to InfluxDB'); + globals.logger.verbose('WINDOWS SERVICE STATUS: Sent Windows service status data to InfluxDB'); }) .catch((err) => { - globals.logger.error(`INFLUXDB WINDOWS SERVICE STATUS: Error saving Windows service status to InfluxDB! ${err.stack}`); + globals.logger.error(`WINDOWS SERVICE STATUS: Error saving Windows service status to InfluxDB! ${err.stack}`); }); } // Store information about successful reload tasks to InfluxDB export function postReloadTaskSuccessNotificationInfluxDb(reloadParams) { try { - globals.logger.verbose('[QSEOW] INFLUXDB RELOAD TASK SUCCESS: Sending reload task notification to InfluxDB'); + globals.logger.verbose('[QSEOW] RELOAD TASK SUCCESS: Sending reload task notification to InfluxDB'); // Add tags let tags = {}; @@ -589,7 +585,7 @@ export function postReloadTaskSuccessNotificationInfluxDb(reloadParams) { // Get task info const { taskInfo } = reloadParams; - globals.logger.debug(`[QSEOW] INFLUXDB RELOAD TASK SUCCESS: Task info:\n${JSON.stringify(taskInfo, null, 2)}`); + globals.logger.debug(`[QSEOW] RELOAD TASK SUCCESS: Task info:\n${JSON.stringify(taskInfo, null, 2)}`); // Use task info to enrich log entry sent to InfluxDB datapoint[0].tags.task_executingNodeName = taskInfo.executingNodeName; @@ -652,26 +648,24 @@ export function postReloadTaskSuccessNotificationInfluxDb(reloadParams) { .then(() => { globals.logger.silly( - `[QSEOW] INFLUXDB RELOAD TASK SUCCESS: Influxdb datapoint for reload task notification: ${JSON.stringify(datapoint, null, 2)}`, + `[QSEOW] RELOAD TASK SUCCESS: Influxdb datapoint for reload task notification: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.verbose('[QSEOW] INFLUXDB RELOAD TASK SUCCESS: Sent reload task notification to InfluxDB'); + globals.logger.verbose('[QSEOW] RELOAD TASK SUCCESS: Sent reload task notification to InfluxDB'); }) .catch((err) => { - globals.logger.error( - `[QSEOW] INFLUXDB RELOAD TASK SUCCESS: Error saving reload task notification to InfluxDB! ${err.stack}`, - ); + globals.logger.error(`[QSEOW] RELOAD TASK SUCCESS: Error saving reload task notification to InfluxDB! ${err.stack}`); }); } catch (err) { - globals.logger.error(`[QSEOW] INFLUXDB RELOAD TASK SUCCESS: ${err}`); + globals.logger.error(`[QSEOW] RELOAD TASK SUCCESS: ${err}`); } } // Store information about failed reload tasks to InfluxDB export function postReloadTaskFailureNotificationInfluxDb(reloadParams) { try { - globals.logger.info('[QSEOW] INFLUXDB RELOAD TASK FAILED: Sending reload task notification to InfluxDB'); + globals.logger.info('[QSEOW] RELOAD TASK FAILED: Sending reload task notification to InfluxDB'); // Add tags let tags = {}; @@ -725,7 +719,7 @@ export function postReloadTaskFailureNotificationInfluxDb(reloadParams) { scriptLogData.scriptLogTail = ''; } - globals.logger.debug(`[QSEOW] INFLUXDB RELOAD TASK FAILED: Script log data:\n${JSON.stringify(scriptLogData, null, 2)}`); + globals.logger.debug(`[QSEOW] RELOAD TASK FAILED: Script log data:\n${JSON.stringify(scriptLogData, null, 2)}`); // Use script log data to enrich log entry sent to InfluxDB datapoint[0].tags.task_executingNodeName = scriptLogData.executingNodeName; @@ -797,18 +791,16 @@ export function postReloadTaskFailureNotificationInfluxDb(reloadParams) { .then(() => { globals.logger.silly( - `[QSEOW] INFLUXDB RELOAD TASK FAILED: Influxdb datapoint for reload task notification: ${JSON.stringify(datapoint, null, 2)}`, + `[QSEOW] RELOAD TASK FAILED: Influxdb datapoint for reload task notification: ${JSON.stringify(datapoint, null, 2)}`, ); datapoint = null; - globals.logger.verbose('[QSEOW] INFLUXDB RELOAD TASK FAILED: Sent reload task notification to InfluxDB'); + globals.logger.verbose('[QSEOW] RELOAD TASK FAILED: Sent reload task notification to InfluxDB'); }) .catch((err) => { - globals.logger.error( - `[QSEOW] INFLUXDB RELOAD TASK FAILED: Error saving reload task notification to InfluxDB! ${err.stack}`, - ); + globals.logger.error(`[QSEOW] RELOAD TASK FAILED: Error saving reload task notification to InfluxDB! ${err.stack}`); }); } catch (err) { - globals.logger.error(`[QSEOW] INFLUXDB RELOAD TASK FAILED: ${err}`); + globals.logger.error(`[QSEOW] RELOAD TASK FAILED: ${err}`); } } From cbdfce35628705589c5146674db24bf753bdee59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Thu, 24 Oct 2024 11:31:56 +0000 Subject: [PATCH 4/4] fix(influxdb): Remove pre-defined schema for InfluxDB database Fixes #1286 --- src/globals.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/globals.js b/src/globals.js index d0dde51f..c5652069 100644 --- a/src/globals.js +++ b/src/globals.js @@ -364,28 +364,7 @@ class Settings { database: this.config.get('Butler.influxDb.dbName'), username: `${this.config.get('Butler.influxDb.auth.enable') ? this.config.get('Butler.influxDb.auth.username') : ''}`, password: `${this.config.get('Butler.influxDb.auth.enable') ? this.config.get('Butler.influxDb.auth.password') : ''}`, - schema: [ - { - measurement: 'butler_memory_usage', - fields: { - heap_used: Influx.FieldType.FLOAT, - heap_total: Influx.FieldType.FLOAT, - external: Influx.FieldType.FLOAT, - process_memory: Influx.FieldType.FLOAT, - }, - tags: ['butler_instance', 'version'], - }, - { - measurement: 'win_service_state', - fields: { - state_num: Influx.FieldType.INTEGER, - state_text: Influx.FieldType.STRING, - startup_mode_num: Influx.FieldType.INTEGER, - startup_mode_text: Influx.FieldType.STRING, - }, - tags: ['butler_instance', 'host', 'service_name', 'display_name', 'friendly_name'], - }, - ], + schema: [], }); }