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


How can I change the size of PhantomJS full web page screenshots?

Votes:

0

Your Vote:

Up

Down

I would like to change the default viewport size of web page screenshots that are downloaded with the HTTP Full Web Page sensor in PhantomJS mode. The screenshots have an inappropriate window size for some monitored web pages, for example, they appear only in a “mobile” format.

How can I get a common desktop size for the created screenshots?

custom http http-full-web-page phantomjs prtg screenshots sensor web-page

Created on Apr 28, 2014 1:12:57 PM by  Gerald Schoch [Paessler Support]

Last change on Jul 8, 2019 9:18:27 AM by  Maike Behnsen [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 19 or later

Defining Viewport Size for the HTTP Full Web Page Sensor

If you use the HTTP Full Web Page sensor with the headless webkit engine PhantomJS, you are able to create a visual history of web pages. However, if the monitored web page adapts itself based on the user agent screen size, the stored screenshots of the page might appear in an inappropriate size. For example, the HTTP Full Web Page sensor stores the screenshots of specific web pages only in mobile format but screenshots of other web pages in the desired desktop size.

If you would like to set the HTTP Full Web Page sensor to render page screenshots in a common desktop size, you have to define the viewport size for the layout process. Doing so, the sensor will simulate the window size like in a common browser.

For details about this PhantomJS property, refer to the PhantomJS API Reference WebPage.

How to Set the Viewport Size for PRTG

PRTG provides a configurable JScript file for the PhantomJS engine that is used by the HTTP Full Web Page sensor. There, you just have to insert the desired size parameters into the viewportSize property. Follow the steps below.

Note: If you manually define the viewport size for the PhantomJS API of PRTG, the file size of the screenshots will increase and a lot of disk space will be used. In extreme cases, this might result in broken HTTP Full Web Page sensors on the affected probe. However, if you enable the Render and store a screenshot of most recent sensor result as JPG option, there will usually be no issues.

  1. Stop the PRTG probe service on the machine running the probe with the affected HTTP Full Web Page sensor.
  2. On the system with this probe, go to the \Sensor System subfolder of PRTG Network Monitor.
  3. Open the file phloadspeed.js with an editor.
  4. Add the viewport size property:
    page.viewportSize = {width: 1280, height: 1024};
    1. You can set width and height as you like.
    2. Save your changes.
  5. Restart the probe service.

The upper part of phloadspeed.js will look like this (perhaps without username and password): var page = require('webpage').create(), system = require('system'), t, resultfile, address; var currentUrl = "", userName = '', passWord = ''; page.viewportSize = {width: 1280, height: 1024};

The HTTP Full Web Page sensor will now create screenshots rendered in the defined viewport size.

Created on Apr 28, 2014 1:15:11 PM by  Gerald Schoch [Paessler Support]

Last change on Jul 25, 2019 5:20:33 AM by  Maike Behnsen [Paessler Support]



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.