Skip to content

Commit

Permalink
Merge pull request #3637 from zowe/v2.x/feature/diagnose
Browse files Browse the repository at this point in the history
zwe diagnose running under configmgr
  • Loading branch information
MarkAckert authored Feb 14, 2024
2 parents d52a333 + 1f334af commit e9156fa
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 44 deletions.
13 changes: 8 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to the Zowe Installer will be documented in this file.
<!--Add the PR or issue number to the entry if available.-->
## `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
Expand All @@ -17,18 +24,14 @@ 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.

## `2.12.0`

### New features and enhancements

#### 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
Expand Down
70 changes: 52 additions & 18 deletions bin/commands/diagnose/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
71 changes: 50 additions & 21 deletions bin/commands/diagnose/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit e9156fa

Please sign in to comment.