The Diagnostics CLI can be installed and run with a single command on Linux and Windows. This installation method will download the Diagnostics CLI binary to the present working directory. The Diagnostics CLI automatically searches its root directory and subdirectories for agent configuration files and other relevant data.
Change directory to the application's root directory.
Recommendation: Scope your troubleshooting with a task suite (-suites), and upload relevant files to your New Relic account with the attachment flag (-attach).
Change directory to the application's root directory.
Recommendation: Scope your troubleshooting with a task suite (-suites), and upload relevant files to your New Relic account with the attachment flag (-attach).
Platform-specific manual installation procedures
To manually install and run the Diagnostics CLI, follow the procedures for your platform:
Ensure you have the Diagnostics CLI:
From the command line, change the directory to your application's root directory and ensure that the nrdiag.zip file is present.
From the nrdiag_1.2.3/win directory, move nrdiag.exe or nrdiag_x64.exe into the application's root directory.
For troubleshooting web applications, ensure you are running the executable from your project's parent directory, or specify your config file location with the -c option.
Run the executable (along with any CLI options from the directory you placed the binary. Since some checks require elevated permissions, for best results run from an admin shell.
Run via PowerShell if you add any CLI_OPTIONS:
./nrdiag.exe CLI_OPTIONS
OR, for x64 systems:
./nrdiag_x64.exe CLI_OPTIONS
The Diagnostics CLI outputs any issues it discovers, and uploads relevant files to New Relic account if you include the -attach flag.
Ensure you have the Diagnostics CLI:
From the command line, change directory to the application's root directory and ensure that the nrdiag.zip file is present.
Copy the binary to the container. Replace IMAGE_NAME with the name of your docker container:
docker cp nrdiag/linux/nrdiag IMAGE_NAME:/bin
Run the nrdiag command in the docker container. Replace IMAGE_NAME as above, and replace APPLICATION_ROOT with the root directory of your application, where you installed the New Relic agent:
(Optional) Remove the nrdiag binary when finished:
docker exec IMAGE_NAME rm /bin/nrdiag
Suites flag (highly recommended CLI option)
A suite is a collection of health checks that target specific products or issues. Using a suite can help narrow the scope of troubleshooting and reduce the occurrence of false positives.
To review a list of available suites, run the Diagnostics CLI with the -help suites option:
./nrdiag -help suites
To run suites with nrdiag, provide the -suites flag and one or more suite names (for example, java) to run as arguments.
Linux and macOS:
For 64-bit systems:
./nrdiag_x64 -suites SUITE NAMES
For ARM64 systems:
./nrdiag_arm64 -suites SUITE NAMES
Windows:
To run from PowerShell, add ./ to the start of cmd.
For 32-bit systems:
nrdiag.exe -suites SUITE NAMES
For 64-bit systems:
nrdiag_x64.exe -suites SUITE NAMES
For ARM64 systems:
nrdiag_arm64 -suites SUITE NAMES
Include additional files in the zip
If you have additional files that you would like to share with support, you can include them in the nrdiag-output.zip file using the -include command line flag. This can be used with a single file or a directory. If a directory is provided, all of its subdirectories are included. The total size limit of the files included is 4GB.
Use this in combination with -attach to upload the files to your New Relic account.
If your system is not configured to connect to external IP addresses, this method will not work. Instead, attach the output files in an email to New Relic Support.
Automatic account upload
To upload your results automatically to a New Relic account when the Diagnostics CLI is executed, use either the -attach or -api-key command line flags. The -attach flag will validate any New Relic license keys found in your environment and upload the run to the account associated with the license key. Alternatively, the -api-key flag will use the provided to upload the run, regardless of the presence of a valid license key.
Uploading your results to an account will automatically upload the contents of the nrdiag-output.json and nrdiag-output.zip.
For 64-bit systems:
./nrdiag_x64 -attach
OR
./nrdiag_x64 -api-key ${APIKEY}
For ARM64 systems:
./nrdiag_arm64 -attach
OR
./nrdiag_arm64 -api-key ${APIKEY}
To run from PowerShell, add ./ to the start of cmd.