Hi,
I'm using powershell to try and collect the techsupport logs for edges by running this:
Invoke-WebRequest -Uri "https://<nsxmanagerIP>/api/4.0/edges/<edge-id>/techsupportlogs" -Method Get -Headers $Headers -ContentType "application/xml"
This command works but I can't seem to get anything useful out of what is returned. If I output this to a file, it is not a log file. If i dive into the content of the returned XML, it looks like a compressed file to me - which is what I would expect. However, if I try to output this content into a .gz file, every archive tool i've tried says that it is corrupted. I'm at a loss!
for anyone who comes across this thread, this works:
Invoke-WebRequest -Uri "https://X.X.X.X/api/4.0/edges/edge-X/techsupportlogs" -Method Get -Headers $Headers -ContentType "application/xml" -OutFile "C:\Users\XXXXXX\Desktop\EdgeLogs.tar.gz"
Have you read the API documentation?
https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.3/nsx_63_api.pdf (page 282)
With the GET request, you only request the creation of support bundles. The response to this GET request will return a location field in the header with an URL from which you can easily download the compressed support package.
So you need 2 GET Requests. The first to create the support bundle. Then you evaluate the location field in the response header and make another GET request to this location to download the file.
However, there are KB articles for the NSX Controller support bundles that these sometimes take longer to create and the browser runs into a timeout. Maybe this also causes problems when creating Edge Support Bundles. But I don't know.
Hi,
Thanks for the response, that at least clarifies what I thought could be the case. However, I've tried to navigate to the location given in the baseresponse in browser and also tried a GET request against this URL, but always receive "the requested resource is not available" - it doesn't matter how long I wait after making the initial request, any ideas?
If I follow the example in the API documents, it works with "curl":
curl -k -L -s -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXX' -H "Content-Type: application/xml" -H "Accept: application/xml" -X GET https://10.5.5.15/api/4.0/edges/edge-19/techsupportlogs > NSX_Edge_Support_edge-19.log.gz
And after that:
gunzip NSX_Edge_Support_edge-19.log.gz
This is successful.
But all other attempts with a manual download failed. Here I cannot unpack the received data either, because a "not in gzip format" error occurs.
I'm sorry. Unfortunately I can't help you at this point.
for anyone who comes across this thread, this works:
Invoke-WebRequest -Uri "https://X.X.X.X/api/4.0/edges/edge-X/techsupportlogs" -Method Get -Headers $Headers -ContentType "application/xml" -OutFile "C:\Users\XXXXXX\Desktop\EdgeLogs.tar.gz"