New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


HTTP API: How To Retrieve PRTG Chart Using cURL

Votes:

0

Your Vote:

Up

Down

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 by  HorstHorstmann (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

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 by  Frank Carius (270) 1 1



Please log in or register to enter your reply.


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.