elastic / support-diagnostics

Support diagnostics utility for elasticsearch and logstash
Other
290 stars 150 forks source link

Polish scripts #641

Closed sakurai-youhei closed 11 months ago

sakurai-youhei commented 1 year ago
Test: Run bat files in source ```console C:\Users\YouheiSakurai\git\support-diagnostics>scripts\diagnostics.bat --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest C:\Users\YouheiSakurai\git\support-diagnostics>scripts\import-monitoring.bat --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest C:\Users\YouheiSakurai\git\support-diagnostics>scripts\export-monitoring.bat --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest C:\Users\YouheiSakurai\git\support-diagnostics>scripts\scrub.bat --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest ```
Test: Run bat files in dist ```console C:\Users\YouheiSakurai\git\support-diagnostics>diagnostics-8.4.4-SNAPSHOT\diagnostics.bat --help No Java Home was found. Using current path. If execution fails please install Java and make sure it is in the search path or exposed via the JAVA_HOME environment variable. Using -Xms256m -Xmx2000m for options. 2023-05-27 04:24:45,370 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... C:\Users\YouheiSakurai\git\support-diagnostics>diagnostics-8.4.4-SNAPSHOT\import-monitoring.bat --help No Java Home was found. Using current path. If execution fails please install Java and make sure it is in the search path or exposed via the JAVA_HOME environment variable. Using -Xms256m -Xmx2000m for options. 2023-05-27 04:25:30,285 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... C:\Users\YouheiSakurai\git\support-diagnostics>diagnostics-8.4.4-SNAPSHOT\export-monitoring.bat --help No Java Home was found. Using current path. If execution fails please install Java and make sure it is in the search path or exposed via the JAVA_HOME environment variable. Using -Xms256m -Xmx2000m for options. 2023-05-27 04:25:56,400 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... C:\Users\YouheiSakurai\git\support-diagnostics>diagnostics-8.4.4-SNAPSHOT\scrub.bat --help No Java Home was found. Using current path. If execution fails please install Java and make sure it is in the search path or exposed via the JAVA_HOME environment variable. Using -Xms8g -Xmx8g for options. 2023-05-27 04:26:15,047 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... ```
Test: Run sh files in source ```console root@wsl:/mnt/c/Users/YouheiSakurai/git/support-diagnostics# scripts/diagnostics.sh --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest root@wsl:/mnt/c/Users/YouheiSakurai/git/support-diagnostics# scripts/import-monitoring.sh --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest root@wsl:/mnt/c/Users/YouheiSakurai/git/support-diagnostics# scripts/export-monitoring.sh --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest root@wsl:/mnt/c/Users/YouheiSakurai/git/support-diagnostics# scripts/scrub.sh --help Diagnostic executable not found: Please make sure that you are running with the archive ending with '-dist.zip' in the name and not the one labeled 'Source code'. Download at https://github.com/elastic/support-diagnostics/releases/latest ```
Test: Run bat files in dist ```console bash-4.4# diagnostics-8.4.4-SNAPSHOT/diagnostics.sh --help Using /usr/java/openjdk-18/bin/java as Java Runtime Using -Xms256m -Xmx2000m for options. 2023-05-26 19:30:17,966 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... bash-4.4# diagnostics-8.4.4-SNAPSHOT/import-monitoring.sh --help Using /usr/java/openjdk-18/bin/java as Java Runtime Using -Xms256m -Xmx2000m for options. 2023-05-26 19:30:48,120 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... bash-4.4# diagnostics-8.4.4-SNAPSHOT/export-monitoring.sh --help Using /usr/java/openjdk-18/bin/java as Java Runtime Using -Xms256m -Xmx2000m for options. 2023-05-26 19:31:07,463 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... bash-4.4# diagnostics-8.4.4-SNAPSHOT/scrub.sh --help Using /usr/java/openjdk-18/bin/java as Java Runtime Using -Xms8g -Xmx8g for options. 2023-05-26 19:31:29,387 main ERROR Unable to locate appender "diag" for logger config "root" SLF4J: Class path contains multiple SLF4J bindings. ... ```
sakurai-youhei commented 1 year ago
diff between diagnostics.sh and import-monitoring.sh ```diff --- scripts/diagnostics.sh 2023-05-27 03:30:24.935367000 +0900 +++ scripts/import-monitoring.sh 2023-05-27 03:30:22.879920300 +0900 @@ -1,7 +1,7 @@ #!/usr/bin/env bash scriptDir="$0" -scriptDir="${scriptDir/\/diagnostics.sh/$''}" +scriptDir="${scriptDir/\/import-monitoring.sh/$''}" libDir="$scriptDir"'/lib' if [ ! -d "$libDir" ]; then @@ -32,4 +32,4 @@ [[ "${DIAG_JAVA_OPTS}" == "" ]] && export DIAG_JAVA_OPTS="-Xms256m -Xmx2000m" echo "Using ${DIAG_JAVA_OPTS} ${DIAG_DEBUG_OPTS} for options." -"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp "${scriptDir}/config:${scriptDir}/lib/*" co.elastic.support.diagnostics.DiagnosticApp "$@" +"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp "${scriptDir}/config:${scriptDir}/lib/*" co.elastic.support.monitoring.MonitoringImportApp "$@" ```
diff between diagnostics.sh and export-monitoring.sh ```diff --- scripts/diagnostics.sh 2023-05-27 03:30:24.935367000 +0900 +++ scripts/export-monitoring.sh 2023-05-27 03:30:24.036204500 +0900 @@ -1,7 +1,7 @@ #!/usr/bin/env bash scriptDir="$0" -scriptDir="${scriptDir/\/diagnostics.sh/$''}" +scriptDir="${scriptDir/\/export-monitoring.sh/$''}" libDir="$scriptDir"'/lib' if [ ! -d "$libDir" ]; then @@ -32,4 +32,4 @@ [[ "${DIAG_JAVA_OPTS}" == "" ]] && export DIAG_JAVA_OPTS="-Xms256m -Xmx2000m" echo "Using ${DIAG_JAVA_OPTS} ${DIAG_DEBUG_OPTS} for options." -"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp "${scriptDir}/config:${scriptDir}/lib/*" co.elastic.support.diagnostics.DiagnosticApp "$@" +"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp "${scriptDir}/config:${scriptDir}/lib/*" co.elastic.support.monitoring.MonitoringExportApp "$@" ```
diff between diagnostics.sh and scrub.sh ```diff --- scripts/diagnostics.sh 2023-05-27 03:30:24.935367000 +0900 +++ scripts/scrub.sh 2023-05-27 03:30:21.295919000 +0900 @@ -1,7 +1,7 @@ #!/usr/bin/env bash scriptDir="$0" -scriptDir="${scriptDir/\/diagnostics.sh/$''}" +scriptDir="${scriptDir/\/scrub.sh/$''}" libDir="$scriptDir"'/lib' if [ ! -d "$libDir" ]; then @@ -29,7 +29,7 @@ [[ "${DIAG_DEBUG}" != "" ]] && export DIAG_DEBUG_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y" -[[ "${DIAG_JAVA_OPTS}" == "" ]] && export DIAG_JAVA_OPTS="-Xms256m -Xmx2000m" +[[ "${DIAG_JAVA_OPTS}" == "" ]] && export DIAG_JAVA_OPTS="-Xms8g -Xmx8g" echo "Using ${DIAG_JAVA_OPTS} ${DIAG_DEBUG_OPTS} for options." -"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp "${scriptDir}/config:${scriptDir}/lib/*" co.elastic.support.diagnostics.DiagnosticApp "$@" +"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp "${scriptDir}/config:${scriptDir}/lib/*" co.elastic.support.scrub.ScrubApp "$@" ```
diff between diagnostics.bat and import-monitoring.bat ```diff --- scripts/diagnostics.bat 2023-05-27 04:20:26.268379800 +0900 +++ scripts/import-monitoring.bat 2023-05-27 04:20:40.832312200 +0900 @@ -33,6 +33,6 @@ ) echo Using %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% for options. -"%JAVA_EXEC%" %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% -cp %diagpath%\config;%diagpath%\lib\* co.elastic.support.diagnostics.DiagnosticApp %* +"%JAVA_EXEC%" %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% -cp %diagpath%\config;%diagpath%\lib\* co.elastic.support.monitoring.MonitoringImportApp %* endlocal ```
diff between diagnostics.bat and export-monitoring.bat ```diff --- scripts/diagnostics.bat 2023-05-27 04:20:26.268379800 +0900 +++ scripts/export-monitoring.bat 2023-05-27 04:20:34.225764900 +0900 @@ -33,6 +33,6 @@ ) echo Using %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% for options. -"%JAVA_EXEC%" %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% -cp %diagpath%\config;%diagpath%\lib\* co.elastic.support.diagnostics.DiagnosticApp %* +"%JAVA_EXEC%" %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% -cp %diagpath%\config;%diagpath%\lib\* co.elastic.support.monitoring.MonitoringExportApp %* endlocal ```
diff between diagnostics.bat and scrub.bat ```diff --- scripts/diagnostics.bat 2023-05-27 04:20:26.268379800 +0900 +++ scripts/scrub.bat 2023-05-27 04:20:46.509470900 +0900 @@ -29,10 +29,10 @@ ) if not defined DIAG_JAVA_OPTS ( - set DIAG_JAVA_OPTS=-Xms256m -Xmx2000m + set DIAG_JAVA_OPTS=-Xms8g -Xmx8g ) echo Using %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% for options. -"%JAVA_EXEC%" %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% -cp %diagpath%\config;%diagpath%\lib\* co.elastic.support.diagnostics.DiagnosticApp %* +"%JAVA_EXEC%" %DIAG_JAVA_OPTS% %DIAG_DEBUG_OPTS% -cp %diagpath%\config;%diagpath%\lib\* co.elastic.support.scrub.ScrubApp %* endlocal ```