What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Response Header - API

Votes:

0

Hello,

I am trying to query table.json via the API. Using Postman or curl my results look great.

https://x.y.z/api/table.json?content=devices&columns=device,host,tags&output=json&filter_tags=@tag(IOS,NXOS,DNOS,FTOS,FortiOS,EtherHaul,SonicOS,AirFiber)&filter_type=@sub(device)&sortby=name&username=YYYY&passhash=xxxxxxxx&filter_status=3&filter_status=4

Do API responses send data back using zlib/deflate?

The application I am trying to integrate with (Oxidizer) keeps thinking the PRTG response is zlib compressed; however, fails to decompress the data correctly.

Thank you kindly

deflate oxidizer prtg zlib

Created on Dec 31, 2019 7:14:34 PM

Last change on Jan 1, 2020 9:10:15 AM by  Moritz Heller [Paessler Support]



Best Answer

Accepted Answer

Votes:

0

Hi tlister,

Thank you for the information.

I talked with the developer and received the information that the "deflate" version is not the latest one. Therefore, it's possible that "deflate" is not correctly recognized.

Created on Jan 3, 2020 1:07:55 PM by  Moritz Heller [Paessler Support]



5 Replies

Votes:

0

Hi tlister,

If you use the JSON output, the content is encoded by "deflate". You can also check this via the developer tools of your browser (network tab)-

Created on Jan 1, 2020 9:16:33 AM by  Moritz Heller [Paessler Support]



Votes:

0

Hello Moritz,

Thank you for the reply.

Yes, when I query the API with the "deflate" header set in my query, the returned data does not appear to be encoded correctly (I am unable to uncompress the data as I would expect).

Below is an example to illustrate what I'm trying to communicate.

curl -H "Accept-Encoding: gzip, deflate, identity" "https://xyz/api/table.json?content=devices&columns=device,host,tags&output=json&filter_tags=@tag(IOS,NXOS,DNOS,FTOS,FortiOS,EtherHaul,SonicOS,AirFiber)&filter_type=@sub(device)&sortby=name&username=oxidizer&passhash=xxxxxxxx&filter_status=3&filter_status=4" -k > test
$ zlib-flate -uncompress < test
flate: inflate: data: incorrect header check

If I do the same query without specifying 'deflate" the results are returned uncompressed and as expected.

The author of the other application I am integrating against has suggested that I contact Paessler to verify there are no known bugs with how the returned data is compressed using 'deflate'.

In addition, for my own sanity in getting this working, is there a flag I can set in a PRTG config file to disable support for 'deflate compression' similar as to how I would in other web servers such as nginx/apache/etc?

Kind regards,

Created on Jan 1, 2020 10:07:04 AM



Votes:

0

Hi tlister,

Thank you for the update.

I talked with a colleague and he mentioned that "deflate" is only used when the other side accepts "deflate".

Created on Jan 1, 2020 1:43:59 PM by  Moritz Heller [Paessler Support]



Votes:

0

Hi Moritz,

Either forum is fine; however, in the interest of someone else having a similar issue as me, I'd like this info to remain public.

Regarding the returned compressed 'deflate' data. The reason I'm opening this ticket is because I believe the data being returned by the PRTG API is not compressed correctly when I set "deflate" on my query.

When I try to uncompress the results of my query (with multiple tools, one example is in my previous message) I am given the same error of "incorrect header check". I and others I have been working with believe PRTG may not be compressing the data correctly.

I would just like to confirm that there are no known issues with the PRTG API when using gzip compression (deflate).

Thanks,

Created on Jan 2, 2020 1:33:05 AM



Accepted Answer

Votes:

0

Hi tlister,

Thank you for the information.

I talked with the developer and received the information that the "deflate" version is not the latest one. Therefore, it's possible that "deflate" is not correctly recognized.

Created on Jan 3, 2020 1:07:55 PM by  Moritz Heller [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.