์ง๋จ CLI ์ค์น ๋ฐ ์คํ
์ง๋จ CLI๋ Linux ๋ฐ Windows์์ ๋จ์ผ ๋ช ๋ น์ผ๋ก ์ค์นํ๊ณ ์คํํ ์ ์์ต๋๋ค. ์ด ์ค์น ๋ฐฉ๋ฒ์ ์ง๋จ CLI ๋ฐ์ด๋๋ฆฌ๋ฅผ ํ์ฌ ์์ ๋๋ ํฐ๋ฆฌ์ ๋ค์ด๋ก๋ํฉ๋๋ค. ์ง๋จ CLI๋ ์์ด์ ํธ ๊ตฌ์ฑ ํ์ผ ๋ฐ ๊ธฐํ ๊ด๋ จ ๋ฐ์ดํฐ์ ๋ํ ๋ฃจํธ ๋๋ ํฐ๋ฆฌ ๋ฐ ํ์ ๋๋ ํฐ๋ฆฌ๋ฅผ ์๋์ผ๋ก ๊ฒ์ํฉ๋๋ค.
ํ๋ซํผ๋ณ ์๋ ์ค์น ์ ์ฐจ
์ง๋จ CLI๋ฅผ ์๋์ผ๋ก ์ค์นํ๊ณ ์คํํ๋ ค๋ฉด ํ๋ซํผ์ ๋ํ ์ ์ฐจ๋ฅผ ๋ฐ๋ฅด์ญ์์ค.
์ค์ํธ ํ๋๊ทธ(๊ถ์ฅ๋๋ CLI ์ต์ )
์ ํ๊ตฐ์ ํน์ ์ ํ ๋๋ ๋ฌธ์ ๋ฅผ ๋์์ผ๋ก ํ๋ ์ํ ํ์ธ ๋ชจ์์ ๋๋ค. ์ ํ๊ตฐ์ ์ฌ์ฉํ๋ฉด ๋ฌธ์ ํด๊ฒฐ ๋ฒ์๋ฅผ ์ขํ๊ณ ์คํ์ง ๋ฐ์์ ์ค์ผ ์ ์์ต๋๋ค.
์ฌ์ฉ ๊ฐ๋ฅํ ์ ํ๊ตฐ ๋ชฉ๋ก์ ๊ฒํ ํ๋ ค๋ฉด -help suites ์ต์
๊ณผ ํจ๊ป ์ง๋จ CLI๋ฅผ ์คํํฉ๋๋ค.
$./nrdiag -help suitesnrdiag ์ผ๋ก ์ ํ๊ตฐ์ ์คํํ๋ ค๋ฉด -suites ํ๋๊ทธ์ ํ๋ ์ด์์ ์ ํ๊ตฐ ์ด๋ฆ(์: java )์ ์ ๊ณตํ์ฌ ์ธ์๋ก ์คํํ ์ ์์ต๋๋ค.
Linux and macOS:
64๋นํธ ์์คํ ์ ๊ฒฝ์ฐ:
bash$./nrdiag_x64 -suites SUITE NAMESARM64 ์์คํ ์ ๊ฒฝ์ฐ:
bash$./nrdiag_arm64 -suites SUITE NAMES
Windows:
PowerShell์์ ์คํํ๋ ค๋ฉด cmd ์์ ๋ถ๋ถ์ ./ ๋ฅผ ์ถ๊ฐํฉ๋๋ค.
32๋นํธ ์์คํ ์ ๊ฒฝ์ฐ:
bash$nrdiag.exe -suites SUITE NAMES64๋นํธ ์์คํ ์ ๊ฒฝ์ฐ:
bash$nrdiag_x64.exe -suites SUITE NAMESARM64 ์์คํ ์ ๊ฒฝ์ฐ:
bash$nrdiag_arm64.exe -suites SUITE NAMES
์คํฌ๋ฆฝํธ
์คํฌ๋ฆฝํธ๋ ์์ ์ผ๋ก ์์ง๋์ง ์์ ์ ๋ณด์ ๋ํ ์ถ๊ฐ ๋ฐ์ดํฐ ์์ค๋ฅผ ์ ๊ณตํฉ๋๋ค. ์ฌ์ฉ ๊ฐ๋ฅํ ์คํฌ๋ฆฝํธ ์นดํ๋ก๊ทธ๋ Diagnostic CLI์ github ์ ์ฅ์ ์์ ์ฐพ์ ์ ์์ต๋๋ค.
์คํฌ๋ฆฝํธ ์ถ๋ ฅ
์คํฌ๋ฆฝํธ ์ถ๋ ฅ์ ํ๋ฉด์ ์ธ์๋๊ณ ์คํฌ๋ฆฝํธ ์ด๋ฆ(์: name-of-script.out)์ ๊ธฐ๋ฐ์ผ๋ก ํ์ผ์ ์ ์ฅ๋ฉ๋๋ค. ์ด๋ -output-path ์์ ์ง์ ํ ๋๋ ํ ๋ฆฌ์ ์ ์ฅ๋๋ฉฐ ๊ธฐ๋ณธ๊ฐ์ ํ์ฌ ๋๋ ํ ๋ฆฌ์
๋๋ค.
์คํฌ๋ฆฝํธ๋ ํ์ฌ ์์
๋๋ ํฐ๋ฆฌ๋ -output-path ์์ ์ง์ ํ ๋๋ ํฐ๋ฆฌ๋ก ํ์ผ์ ์ถ๋ ฅํ ์๋ ์์ต๋๋ค. ๋ชจ๋ ์ถ๋ ฅ ํ์ผ์ ScriptOutput/ ๋๋ ํฐ๋ฆฌ์ ๊ฒฐ๊ณผ zip์ ํฌํจ๋ฉ๋๋ค.
์คํฌ๋ฆฝํธ ๊ฒฐ๊ณผ
์คํฌ๋ฆฝํธ ์คํ ๊ฒฐ๊ณผ๋ ๋ค์ ์คํค๋ง๋ฅผ ์ฌ์ฉํ์ฌ nrdiag-output.json ํ์ผ์์ ์ฐพ์ ์ ์์ต๋๋ค.
"Script": { "Name": "example", "Description": "Example Description", "Output": "example output", "OutputFiles": [ "/path/to/example.out", "/path/to/another-file.out" ], "OutputTruncated": false}Output ํ๋์๋ stdout ์ถ๋ ฅ์ด ํฌํจ๋์ด ์์ต๋๋ค. 20000์๋ฅผ ์ด๊ณผํ๋ฉด ์๋ฆฌ๊ณ OutputTruncated ํ๋๊ฐ true ๋ก ์ค์ ๋ฉ๋๋ค. ์๋ฆฌ๋๋ผ๋ zip ํ์ผ์ ScriptOutput/ ๋๋ ํฐ๋ฆฌ์์ ์ ์ฒด ์ถ๋ ฅ์ ๊ณ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์คํฌ๋ฆฝํธ๊ฐ ์์ฑํ ํ์ผ ๋ชฉ๋ก์ Outputfiles ํ๋์์ ์ฐพ์ ์ ์์ต๋๋ค.
์คํฌ๋ฆฝํธ ๋์ด, ๋ณด๊ธฐ ๋ฐ ์คํ
zip์ ์ถ๊ฐ ํ์ผ ํฌํจ
์ง์ํ๊ณผ ๊ณต์ ํ๊ณ ์ถ์ ์ถ๊ฐ ํ์ผ์ด ์๋ ๊ฒฝ์ฐ -include ๋ช
๋ น์ค ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ nrdiag-output.zip ํ์ผ์ ํฌํจํ ์ ์์ต๋๋ค. ์ด๊ฒ์ ๋จ์ผ ํ์ผ ๋๋ ๋๋ ํ ๋ฆฌ์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋๋ ํ ๋ฆฌ๊ฐ ์ ๊ณต๋๋ฉด ๋ชจ๋ ํ์ ๋๋ ํ ๋ฆฌ๊ฐ ํฌํจ๋ฉ๋๋ค. ํฌํจ๋ ํ์ผ์ ์ด ํฌ๊ธฐ ์ ํ์ 4GB์
๋๋ค.
์ด๊ฒ์ -attach ๊ณผ ํจ๊ป ์ฌ์ฉ ํ์ฌ ํ์ผ์ New Relic ๊ณ์ ์ ์
๋ก๋ํ์ญ์์ค .
Linux and macOS:
64๋นํธ ์์คํ ์ ๊ฒฝ์ฐ:
bash$./nrdiag_x64 -include /entire/directory/ -attachARM64 ์์คํ ์ ๊ฒฝ์ฐ:
bash$./nrdiag_arm64 -include /entire/directory/ -attach
Windows:
PowerShell์์ ์คํํ๋ ค๋ฉด cmd ์์ ๋ถ๋ถ์ ./ ๋ฅผ ์ถ๊ฐํฉ๋๋ค.
32๋นํธ ์์คํ ์ ๊ฒฝ์ฐ:
bash$nrdiag.exe -include Path\To\File -attach64๋นํธ ์์คํ ์ ๊ฒฝ์ฐ:
bash$nrdiag_x64.exe -include \Entire\Directory\ -attachARM64 ์์คํ ์ ๊ฒฝ์ฐ:
bash$nrdiag_arm64.exe -include \Entire\Directory\ -attach
New Relic ๊ณ์ ์ ๊ฒฐ๊ณผ ์ ๋ก๋
์ค์
์์คํ ์ด ์ธ๋ถ IP ์ฃผ์์ ์ฐ๊ฒฐํ๋๋ก ๊ตฌ์ฑ๋์ง ์์ ๊ฒฝ์ฐ ์ด ๋ฐฉ๋ฒ์ ์๋ํ์ง ์์ต๋๋ค. ๋์ ์ด๋ฉ์ผ์ ์๋ ์ถ๋ ฅ ํ์ผ์ New Relic ์ง์ํ์ ์ฒจ๋ถํ์ญ์์ค.
์๋ ๊ณ์ ์ ๋ก๋
์ง๋จ CLI๊ฐ ์คํ๋ ๋ ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ ๋ฆญ ๊ณ์ ์ ์๋์ผ๋ก ์
๋ก๋ํ๋ ค๋ฉด -attach ๋๋ -api-key ๋ณตํฉ์ค ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ธ์. -attach ํ๋๊ทธ๋ ํ๊ฒฝ์์ ๋ฐ๊ฒฌ๋ ๋ชจ๋ ๋ด๋ ๋ฆญ ํด๋ฌ์คํฐ ํค์ ์ ํจ์ฑ์ ๊ฒ์ฌํ๊ณ ์ธ์คํด์ค ํค์ ์ฐ๊ฒฐ๋ ๊ณ์ ์ ์คํ์ ์
๋ก๋ํฉ๋๋ค. ๋๋ -api-key ํ๋๊ทธ๋ ์ ํจํ ์ธ์คํด์ค ํค์ ์กด์ฌ ์ฌ๋ถ์ ๊ด๊ณ์์ด ์คํ์ ์
๋ก๋ํ๊ธฐ ์ํด ์ ๊ณต๋ ์ฌ์ฉํฉ๋๋ค.
๊ฒฐ๊ณผ๋ฅผ ๊ณ์ ์ ์
๋ก๋ํ๋ฉด nrdiag-output.json ๋ฐ nrdiag-output.zip ์ ์ฝํ
์ธ ๊ฐ ์๋์ผ๋ก ์
๋ก๋๋ฉ๋๋ค.
์ง์ญ ์ ํ
๊ธฐ๋ณธ์ ์ผ๋ก ์ง๋จ CLI๋ ๋ฏธ๊ตญ ๋ฐ์ดํฐ ์ผํฐ์์ ํธ์คํ
๋๋ New Relic ๊ณ์ ์ ๊ฒฐ๊ณผ๋ฅผ ์
๋ก๋ํฉ๋๋ค. ๊ณ์ ์ด EU ๋ฐ์ดํฐ ์ผํฐ์์ ํธ์คํ
๋๋ ๊ฒฝ์ฐ ๋ช
๋ น์ -region eu ์ถ๊ฐํด์ผ ํฉ๋๋ค.
$./nrdiag -region eu ...