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

Trying to get graphs to a file



I have a script that will call prtg to get a graph, how can i do this? I do not want to show the graph on a page, rather download it to a folder for further processing.

$url = "https://monitor.newcoit.com/chart.png?type=graph&width=900&height=420&graphid=1&id=2192&username=username&userhash=somehas"; echo "<img src='" . $url . "'>";

i am trying to use php file_get_contents or fopen() and when it try these, i get the login page for my prtg instance

api graphs php

Created on May 6, 2014 7:09:05 PM

5 Replies

Accepted Answer




thank you very much for your KB-Post. Can you please try the URL first in a normal browser? Do you then get a graph image shown? Just to check, please use 'passhash' not 'userhash'. The latter does not work.

best regards.

Created on May 7, 2014 12:09:33 PM by  Torsten Lindner [Paessler Support]



the browser works fine.

i can also do echo "<img src='http......'>";

and that works fine too.

$url = "http://....."; the problem is with file_get_contents($url) or fopen($url). when i do these, it returns the login page....

Created on May 7, 2014 2:47:38 PM



That would be a problem in your script then. I'm sorry, but we can't assist with that.

Created on May 7, 2014 3:10:45 PM by  Torsten Lindner [Paessler Support]



so as far as you know, there are no limitations to the types of calls that request the graphs? browser type, curl options or anything?

Created on May 7, 2014 3:12:06 PM



i did not see your passhash comment. that was the problem. thank you.

Created on May 7, 2014 3:19:20 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.