Export Tech Support Report (TSR) using SonicOS API

Description

This article covers how to download Tech Support Report or TSR from the SonicWall device.

The output needs to be saved manually. You are free to choose Swagger, Postman, Git bash, or any application that allows API calls, if you are using a Linux-based operating system you can execute cURL from the terminal. Commands are the same for both Gen6 and Gen7 SonicWall devices. 

For this article, I'm using the Postman App and will be showing the commands to run on cURL for each step.


List of applicable APIs:

Navigate to MANAGE | API and click on the link https://SonicOS-api.sonicwall.com. Swagger will prepopulate your SonicWalls’s IP, MGMT Port, and Firmware so it can give you a list of applicable APIs.
Image



Resolution

Step 1: Enable and log in using SonicOS API

SonicOS API is disabled by default in SonicOS. Any attempt to access SonicOS API while it is disabled results in an HTTP 403 Forbidden error. To use the SonicOS API, you must enable it, either through the SonicOS Management Interface or from the CLI. Please enable the SonicOS API module in the SonicWall UI.

Gen 7: Enable SonicOS API Gen7

Gen 6: Enable SonicOS API Gen6

The above KB also has the steps on how to log in using API Applications

 CAUTION: My SonicWall IP address is 192.168.168.168 with user credentials as admin/password. This has to be kept in mind while running the commands from the below screenshots.  

Step 2: Using GET to export TSR

Image

The output is the Tech Support Report. This can be saved using Copy command (marked as 1 in the above picture) and pasting in notepad. You can also use various Gits to save the file, although that is beyond the scope of this article.

cURL command for the above call is:

curl --location --request GET 'https://192.168.168.168/api/sonicos/export/tech-support-report' \
--header 'Content-Type: application/Json' \
--header 'Authorization: Basic YWRtaW46c29uaWN3YWxs' \
--data '{"override" : true}'


Step 3: Log out the SonicWall with API
It is recommended to log out from the SonicWall via API once the desired configuration is committed.
Log out

curl -k -i -u "admin:password" -X DELETE https://192.168.188.200/api/sonicos/auth
Image

Related Articles

  • SonicOS 8.1.0 FAQ
    Read More
  • SonicWall GEN8 TZs and GEN8 NSas Settings Migration
    Read More
  • Getting started with SonicWall firewalls
    Read More
not finding your answers?