Knowledge Base

Serving Web Pages of PRTG Traffic Grapher With Other Web Servers

Diese Seite steht leider noch nicht auf Deutsch zur Verfügung. Wir bitten um Ihr Verständnis!

With the Version 4 (or later) of PRTG Traffic Grapher brings its own internal web server to provide remote access to the monitoring results using a web browser. Although having an internal web server has many advantages, some users may still want to use another web server software to publish the web pages. This article describes how this can be done.

Advantages of the Internal Web Server

Before deciding to use another web server please have a short look at the advantages of using the internal web server

  • CPU load is drastically lower because the web pages are only generated when they are requested. Periodically writing the HTML files and graphs onto the disk to publish them with another web server (e.g. every 5 minutes) always creates a short CPU load peak (and most of the time the files are never even accessed).
  • The internal web server creates all graphs and tables ?on-the-fly? in the exact moment when the browser requests the page. This way the information is always 100% up to date. When using other web servers the graphs and table are always a little but outdated.
  • The authentication and user accounts of the internal web server can not be used when using other web servers.
  • Some interactive functionality of the web interface does not work with a files based website.

Advantages of Using Other Web Servers

There are also some advantages of using other web servers

  • The webpages of PRTG Traffic Grapher can be served with an already running web server that is already set up and connected to the web.
  • If you website already has a user authentication mechanism you can use that to secure the monitoring pages, too.
  • You do not need another free IP address&port set.

Solution A: The Proxy Server Approach

The technically clean solution is to use a use a web server that can work as a proxy server. Samples are:

Solution B: The Offline Browser and File Based Approach

Please note that this solution is only suitable for a small number of sensors (10 or even less), because downloading the files from the webserver may otherwise take too long to make sense...

For this a little more "low tech" solution we use an offline-browser software to periodically download the files of the web interface using HTTP and writing them into a folder on the hard disk. Then you can configure your web server to serve this folder.

In this sample we are using the freeware HTTrack (V 3.32, installed in c:\httrack). Download the software and install in on the machine you are running PRTG Traffic Grapher on.

Let's use the command line based version of HTTrack. Please create a batch file (e.g. "start.cmd?) with just the following command. It writes the contents of the PRTG web interface onto the disk into the folder c:\httest

C:\httrack\httrack "http://10.0.0.237/prtg.htm" -o "c:\httracktest" -r5 -q
(Please replace 10.0.0.237 with the address you run the PRTG webserver on)

For testing purposes please run the batch file now. Depending on the number of Sensors and Panels this process can take from some seconds to even minutes. Please open the files on your hard disk using a web browser to check their content.

Note: Please disable all authentication mechanisms (admin username/password and panels' username/password) in PRTG, otherwise HTTrack can not download the data.

We now have to make sure that this file generation process runs periodically (e.g. every 5 minutes). This can be achieved using the Scheduled Tasks feature of Windows XP. A detailed description can be found in the Windows XP Help System and online:

http://www.microsoft.com/resources/documentation/.. ..windows/xp/all/proddocs/en-us/schtasks.mspx

The following command schedules start.cmd to run every 20 minutes. Because the command does not include a starting date or time, the task starts 20 minutes after the command completes, and runs every 20 minutes thereafter whenever the system is running. The task is scheduled and executes on the local computer.

schtasks /create /sc minute /mo 20 /tn "HTTrack for PRTG" /tr C:\httrack\start.cmd

(please replace folder and filename with your filename)

In response, SchTasks.exe displays a message explaining that the task will run with the permissions of the current user and requests the current user's password. When you enter the password, SchTasks.exe obscures the text you type.

The task will be created under current logged-in user name.Please enter the password************ 

Then, SchTasks.exe displays a message indicating that the task is scheduled:

SUCCESS: The Scheduled Task "Security Script" has successfully been created. 

From now on the tasks should run as scheduled and you can publish the files using your webserver.

By Category