Knowledge Base
Using live graphs from PRTG in other webpages using static image URLs
Questa pagina anchora non esiste in Italiano. Confidiamo nella Vs. comprensione.
If you want to include live graphs from PRTG into your own webpages (e.g. Intranet) that always show the recent traffic pattern you must encode the date in the graphs' URLs in a relative manner. This article explains the parameters of PRTG's graph URLs.
The easiest way to come up with the IMG URLs is to surf through PRTG's web interface, select the image that you need and copy the IMG's URL.
To get these URLs into the clipboard use the following tricks:
- IE: Install Paessler Site Inspector (Freeware), right click the image and choose "Copy Image URL"
- IE: Right click the image, choose "Properties", while pressing the mouse button move the mouse over the "URL" field which should scroll (can be tricky...) to mark the URL and press CTRL-C
- Firefox: Right click the image and choose "Copy Image URL"
The image URLs that PRTG creates by default in the HTML interface always contain date/time strings. Thus if you use these URLs in static webpages you will not get a live graph. Relative date values must be used for the "from=" and "to=" parameters instead!
Here are explanations of the parameters in IMG URLs for PRTG:
- from/to: To encode "relative" dates in the URL: Use "-number_of_days" and "0" (zero) for the "from=" and "to=" parameters.
- width/height:The parameters "width=" and "height=" control the size of the image (in pixels).
- subid: The "subid=" parameter selects the graph to show:
- 0: Live Graph
- 1: Custom Averages
- 2: Hourly Averages
- 3: Daily Averages
- 4: Graph Legend
- id: The internal id (GUID) of the sensor
Sample URLs:
- Graph with custom averages for two days, 580x110 pixels: Sample
- Graph with custom averages for one day, 580x110 pixels: Sample
- Hourly Averages graph for the last 90 days with a size of 900x500 pixels: Sample
You can also use this technique with Custom Graphs, but in this case you also have to add the path to the custom graph into the URL. The ID is the ID of the custom graph:
By Category
PRTG Traffic Grapher V6