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

HTTP API: How To Retrieve PRTG Chart Using cURL

Votes:

0

Hi Folks, how do I fetch a PRTG chart as .png using the HTTP REST API using curl on Linux?

According to the API documentation, the command line schould look like this:

curl -O -k --location -H "Accept: image/png" -X GET https://prtg/chart.png?type=graph&width=600&height=300&graphid=0&id=54807&username=myUSer&passhash=1234567

Authentication and stuff works fine. MY chrome browser (and even the postman-plugin) show the wanted result. However, the curl-call basically returns an HTML page stating that

JavaScript is not available

Which is correct, as curl obviously does not handle this. Is there a way to pick up just the png image/byte stream?

Best Regards HH

api curl prtg restart

Created on May 13, 2016 9:14:46 AM



1 Reply

Votes:

0

Hi HH,

Keep in mind that the URL contains zwi Special characters. ? = Placeholder in regEx & = concat string to chain commands. You have to Excape them or but put some " aroung

My Line works, too

curl -o c:\temp\test.png -k -v -X GET "https://prtg:443/chart.png?type=graph&width=600&heigh t=300&graphid=0&id=1002&username=prtgadmin&password=xxxxxx"

BTW: You cannot use BasicAuth, because PRTG is not using an authentication Header. the URL contains the Authentication Information. So it is more like "Form Based" wiht prefilled forms.

Frank

Created on Sep 25, 2016 8:19:11 PM




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.