From 312bda6a6de3fd03a9fb8631f590ea25c5a86781 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 27 Oct 2023 10:21:16 +0200 Subject: [PATCH 1/2] zwe diagnose running under configmgr Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 6 +-- bin/commands/diagnose/index.sh | 70 ++++++++++++++++++++++++--------- bin/commands/diagnose/index.ts | 71 ++++++++++++++++++++++++---------- 3 files changed, 104 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0dfd72d56..388029c040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the Zowe Installer will be documented in this file. #### Minor enhancements/defect fixes - Bugfix: Workflow files in the Zowe PAX are now ASCII-encoded. Fixes [#3591](https://github.com/zowe/zowe-install-packaging/issues/3591). +- Enhancement: `/bin/utils/date-add.rex` utility is accepting the date formatting as combination of YY|YYYY, MM, DD and any separator. +- Bugfix: `zwe diagnose` running under comfigmgr and output formatted. Fixes #[3627](https://github.com/zowe/zowe-install-packaging/issues/3627). ## `2.12.0` @@ -15,10 +17,6 @@ All notable changes to the Zowe Installer will be documented in this file. #### Minor enhancements/defect fixes -## `2.13.0` -#### Minor enhancements/defect fixes -- Enhancement: `/bin/utils/date-add.rex` utility is accepting the date formatting as combination of YY|YYYY, MM, DD and any separator. - ## `2.11.0` ### New features and enhancements diff --git a/bin/commands/diagnose/index.sh b/bin/commands/diagnose/index.sh index e843993523..d1f07e8ebe 100644 --- a/bin/commands/diagnose/index.sh +++ b/bin/commands/diagnose/index.sh @@ -11,25 +11,59 @@ # Copyright Contributors to the Zowe Project. ####################################################################### -error_code="${ZWE_CLI_PARAMETER_ERROR_CODE}" +USE_CONFIGMGR=$(check_configmgr_enabled) +if [ "${USE_CONFIGMGR}" = "true" ]; then + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/diagnose/cli.js" +else + + error_code="${ZWE_CLI_PARAMETER_ERROR_CODE}" -server_code=$(echo "${error_code}" | cut -c4) + print_message "" -if echo $error_code | grep -q -E "^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$"; then - if [[ "$server_code" == [Dd] ]]; then - print_message "This code corresponds to the errors related to the ZOWE Desktop and the App Server." - print_message "To find the description of this error code, refer to the Zowe documentation at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/appserver-error-codes.md" - elif [[ "$server_code" == [Ss] ]]; then - print_message "This code corresponds to the errors related to the Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)" - print_message "To find the description of this error code, refer to the Zowe documentation for ZSS at https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes and for ZIS at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/zis-error-codes.md" - elif [[ "$server_code" == [Aa] ]]; then - print_message "This code corresponds to the errors related to the Zowe API Mediation Layer (APIML)." - print_message "To find the description of this error code, refer to the Zowe documentation at https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes" - elif [[ "$server_code" == [Ll] ]]; then - print_message "This code corresponds to the errors related to the Zowe Launcher and ZWE" - print_message "To find the description of this error code, refer to the Zowe documentation for the Launcher at https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes and https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h, and for ZWE at https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/ " + if echo $error_code | grep -q -E "^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$"; then + server_code=$(echo "${error_code}" | cut -c4) + if [[ "$server_code" == [Dd] ]]; then + print_message "This code corresponds to the errors related to the ZOWE Desktop and the App Server." + print_message "" + print_message "To find the description of this error code, refer to the:" + print_message "" + print_message " Zowe documentation for Application framework" + print_message " https://docs.zowe.org/stable/troubleshoot/app-framework/appserver-error-codes" + elif [[ "$server_code" == [Ss] ]]; then + print_message "This code corresponds to the errors related to the Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)." + print_message "" + print_message "To find the description of this error code, refer to the:" + print_message "" + print_message " Zowe documentation for ZSS" + print_message " https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes" + print_message " Zowe documentation for ZIS" + print_message " https://docs.zowe.org/stable/troubleshoot/app-framework/zis-error-codes" + elif [[ "$server_code" == [Aa] ]]; then + print_message "This code corresponds to the errors related to the Zowe API Mediation Layer (APIML)." + print_message "" + print_message "To find the description of this error code, refer to the:" + print_message "" + print_message " Zowe documentation for API Mediation Layer" + print_message " https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes" + elif [[ "$server_code" == [Ll] ]]; then + print_message "This code corresponds to the errors related to the Zowe Launcher and ZWE." + print_message "" + print_message "To find the description of this error code, refer to the:" + print_message "" + print_message " Zowe documentation for Launcher" + print_message " https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes" + print_message " Launcher error codes" + print_message " https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h" + print_message " Zowe documentation for ZWE" + print_message " https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/" + fi + print_message "" + print_message "You may also explore reports from other users experiencing the same error by searching" + print_message "https://github.com/search?q=org%3Azowe+${error_code}&type=discussions" + else + print_error_and_exit "ZWEL0102E: Invalid parameter --error-code='${error_code}'" "" 102 fi - print_message "You may also explore reports from other users experiencing the same error by searching here https://github.com/search?q=org%3Azowe+${error_code}&type=discussions" -else - print_error_and_exit "Invalid Error Code" "" 102 + + print_message "" + fi diff --git a/bin/commands/diagnose/index.ts b/bin/commands/diagnose/index.ts index 1fe91dc198..8fb6518277 100644 --- a/bin/commands/diagnose/index.ts +++ b/bin/commands/diagnose/index.ts @@ -8,31 +8,60 @@ Copyright Contributors to the Zowe Project. */ - import * as std from 'cm_std'; import * as common from '../../libs/common'; -export function execute() { - const errorCode: string = std.getenv('ZWE_CLI_PARAMETER_ERROR_CODE'); +const THIS_CODE = "\nThis code corresponds to the errors related to the"; +const FIND_DESC = "To find the description of this error code, refer to the:\n "; +const URL = { + apiML: "https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes", + appFW : "https://docs.zowe.org/stable/troubleshoot/app-framework/appserver-error-codes", + launcher: "https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes", + launcherGit: "https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h", + zss: "https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes", + zis: "https://docs.zowe.org/stable/troubleshoot/app-framework/zis-error-codes", + zwe: "https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/" +} + +function thisCodeCorrespondsTo(component: string){ + common.printMessage(`${THIS_CODE} ${component}.\n`); + common.printMessage(`${FIND_DESC}`); +} - const serverCode: string = errorCode.charAt(3); +function printLinks(description: string, link: string){ + if (link.indexOf('github') > 0) + common.printMessage(` ${description}`) + else + common.printMessage(` Zowe documentation for ${description}`) + common.printMessage(` ${link}`); +} - if (/^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$/.test(errorCode)) { - if (serverCode.toLowerCase() === 'd') { - common.printMessage("This code corresponds to the errors related to the ZOWE Desktop and the App Server."); - common.printMessage("To find the description of this error code, refer to the Zowe documentation at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/appserver-error-codes.md"); - } else if (serverCode.toLowerCase() === 's') { - common.printMessage("This code corresponds to the errors related to the Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)"); - common.printMessage("To find the description of this error code, refer to the Zowe documentation for ZSS at https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes and for ZIS at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/zis-error-codes.md"); - } else if (serverCode.toLowerCase() === 'a') { - common.printMessage("This code corresponds to the errors related to the Zowe API Mediation Layer (APIML)."); - common.printMessage("To find the description of this error code, refer to the Zowe documentation at https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes"); - } else if (serverCode.toLowerCase() === 'l') { - common.printMessage("This code corresponds to the errors related to the Zowe Launcher and ZWE"); - common.printMessage("To find the description of this error code, refer to the Zowe documentation for the Launcher at https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes and https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h, and for ZWE at https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/"); +export function execute() { + const errorCode = std.getenv('ZWE_CLI_PARAMETER_ERROR_CODE'); + if (/^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$/.test(errorCode)) { + const serverCode = errorCode.charAt(3); + if (serverCode.toLowerCase() === 'd') { + thisCodeCorrespondsTo('ZOWE Desktop and the App Server'); + printLinks('Application framework', `${URL.appFW}`); + } + else if (serverCode.toLowerCase() === 's') { + thisCodeCorrespondsTo('Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)'); + printLinks('ZSS', `${URL.zss}`); + printLinks('ZIS', `${URL.zis}`); + } + else if (serverCode.toLowerCase() === 'a') { + thisCodeCorrespondsTo('Zowe API Mediation Layer (APIML)'); + printLinks('API Mediation Layer', `${URL.apiML}`); + } + else if (serverCode.toLowerCase() === 'l') { + thisCodeCorrespondsTo('Zowe Launcher and ZWE'); + printLinks('Launcher', `${URL.launcher}`); + printLinks('Launcher error codes', `${URL.launcherGit}`); + printLinks('ZWE', `${URL.zwe}`); + } + common.printMessage(`\nYou may also explore reports from other users experiencing the same error by searching\nhttps://github.com/search?q=org%3Azowe+${errorCode}&type=discussions\n`); + } + else { + common.printErrorAndExit(`ZWEL0102E: Invalid parameter --error-code='${errorCode}'`, undefined, 102); } - common.printMessage(`You may also explore reports from other users experiencing the same error by searching here https://github.com/search?q=org%3Azowe+${errorCode}&type=discussions`) - } else { - common.printErrorAndExit("Invalid Error Code", undefined, 102); - } } From 1f334af363e4edb68815d77c05371efb526e5bb4 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Wed, 14 Feb 2024 14:02:20 -0500 Subject: [PATCH 2/2] update changelog to align with 2.15.0 Signed-off-by: MarkAckert --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3292093c2..9edb889b67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to the Zowe Installer will be documented in this file. +## `2.15.0` + +## New features and enhancements + +## Minor enhancements/defect fixes +- Bugfix: `zwe diagnose` running under comfigmgr and output formatted. Fixes #[3627](https://github.com/zowe/zowe-install-packaging/issues/3627). + ## `2.14.0` ### New features and enhancements @@ -18,8 +25,6 @@ All notable changes to the Zowe Installer will be documented in this file. #### Minor enhancements/defect fixes - Bugfix: Workflow files in the Zowe PAX are now ASCII-encoded. Fixes [#3591](https://github.com/zowe/zowe-install-packaging/issues/3591). - Enhancement: `/bin/utils/date-add.rex` utility is accepting the date formatting as combination of YY|YYYY, MM, DD and any separator. -- Bugfix: `zwe diagnose` running under comfigmgr and output formatted. Fixes #[3627](https://github.com/zowe/zowe-install-packaging/issues/3627). - ## `2.12.0`