Zoomdata Version

Setting Up the Screenshot Feature

The Screenshot service provides periodic snapshots of your saved dashboards on Zoomdata's Home page. At this time, Zoomdata only supports 64-bit versions.

Screenshot Service Prerequisites

In version 3.2, Zoomdata's Screenshot service switched from using Firefox to using headless Google Chrome. The Chrome-based Screenshot service provides more capabilities than the Firefox-based Screenshot service. Chrome-based screenshots include the entire dashboard and can be exported in PNG or PDF formats.

The Chrome-based Zoomdata Screenshot service provided with Zoomdata v3.2 and later Zoomdata versions cannot be installed in CentOS v6 environments because the Google Chrome dependencies do not support that platform. Make sure you are running Cent OS v7 or later.

Chrome and ChromeDriver Requirements

Zoomdata's Screenshot service requires the following versions of Google Chrome software:

  • ChromeDriver 2.36 or later
  • Chrome 65.0.3325.162 or later

Obtain the Software

Before you can install the Screenshot service, contact Zoomdata Technical Support to obtain a download link for the service installation software. Be sure you specify the operating system you are using so the appropriate software is provided.

Installing the Screenshot Service

To install the Screenshot service:

  1. Install the correct version of Google Chrome, if you have not done so already.

    Zoomdata provides an installation script you can use to install these minimum versions with their dependencies. The script is install-dependencies.sh and is located in the /opt/zoomdata/docs/screenshot-service/ installation directory.

    If you prefer to obtain the latest versions of Chrome on your own:

  2. Install the correct version of ChromeDriver. Enter the following commands on the command line (for all operating systems):

    CHROMEDRIVER_LATEST_VERSION=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
    curl -s -o /tmp/chromedriver.zip \
    "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_LATEST_VERSION}/chromedriver_linux64.zip" sudo unzip /tmp/chromedriver.zip -d /usr/bin/
    rm -f /tmp/chromedriver.zip
  3. Download the Screenshot service package using the link provided by Zoomdata Technical Support.

  4. Install the software using the appropriate command below, modifying <filename> to match the installation package provided by Zoomdata Technical Support:

    In CentOS 7 environments:

    sudo yum localinstall <filename>.rpm

    In Ubuntu environments:

    sudo dpkg -i <filename>.deb
  5. Optionally, modify the zoomdata.properties file to enable and setup the Screenshot service. In addition to enabling the Screenshot service, you can also set the time period for capturing screenshots of your visuals to be displayed on your Home page.

    • To create screenshots in the background, set the screenshot.daemon.enabled property to true:

    • Specify which types of screenshots you want to enable. Set the screenshots.dashboards.enabled property to true if you want to enable capturing and displaying the screenshots for the dashboards.

    The following table describes the results of the interaction of these two properties:

    screenshot.daemon.enabled screenshots.dashboards.enabled Result of these combinations
    true true

    Screenshots are created in the background.

    Screenshots can be created manually by sending cURL calls.

    Screenshots are shown on the Home page

    false true

    Screenshots are created only one time, when the dashboard is saved.

    Screenshots are not created in the background.

    Screenshots can be created manually by sending proper cURL calls.

    Screenshots are shown on the Home page.

    false false

    Screenshots are not created in the background.

    cURL calls to create screenshots on demand have no effect.

    Screenshots are replaced by the default thumbnails.

    true false

    Screenshots are not created in the background.

    cURL calls to create screenshots on demand have no effect.

    Screenshots are replaced by the default thumbnails.

  6. Specify the frequency at which the screenshots are refreshed by configuring the property screenshot.daemon.schedule.rate=<n>h in zoomdata.properties. The default frequency is every 24 hours, but you can set your own frequency (in hours) by replacing <n> with your desired frequency.

  7. Enable and start the Screenshot service. If you are using systemctl, run the following commands:

    sudo systemctl enable zoomdata-screenshot-service
    sudo systemctl start zoomdata-screenshot-service

    If you are not using systemctl, adjust these commands accordingly. Additional information on restarting Zoomdata services is provided in Restarting Zoomdata Services.

  8. Watch the /opt/zoomdata/logs/screenshot-service.log file. The service is running successfully when the log displays a line similar to this:

    "Started ScreenshotServiceApplication in 12.184 seconds

Screenshots may not immediately populate your home screen, but may become available based on the frequency set in the screenshot.daemon.schedule.rate property.

Testing the Screenshot Service

To test the Screenshot service:

  1. Open a web browser to Zoomdata. Obtain the bookmark ID for a dashboard to use for testing. Log in to Zoomdata and open a dashboard. On the browser address bar copy the portion of the URL after the + sign. In the following example, you would copy 5ad8d1fa60b2894b38f0933b:

    https://vm:8443/zoomdata/visualization/
    				5ad50156e4b07727dcb11098+5ad8d1fa60b2894b38f0933b
  2. Use Postman or curl to issue a PUT request to Zoomdata to request a screenshot of the dashboard in PNG format. In the following example, replace <username> with your user name, <password> with your password, <server> with your server IP address or name, <port> with your port number, and <bookmark> with the bookmark ID you obtained in the previous step.

    curl --insecure -X PUT -u <username>:<password> https://<server>:<port>/zoomdata/api/
    screenshot/<bookmark>?"width=1000&format=PNG" > test.png
  3. If the test.png file is created successfully, the Screenshot service is operating correctly.

Troubleshooting Screenshot Service Problems

Common issues can be resolved by editing the Screenshot service properties file in /etc/zoomdata/screenshot-service.properties and, in some cases, the etc/zoomdata/zoomdata.properties file. Changing values in these files requires a restart of the associated service. See Restarting Zoomdata Services. See also Icons Not Reverting to Defaults After Screenshot Feature Disabled

Timeouts

Zoomdata and the Screenshot service include default timeouts for dashboards to render. If you will be requesting screenshots of dashboards that takes longer than this default, you can increase the default timeout in the properties file.

The Screenshot service may time out on dashboards that take too long to draw. If a selected Zoomdata dashboard takes more than the default timeout, then the default timeout setting in the properties file can be increased.

Determine how much additional time you need, in seconds, for the dashboards to load or render and then add properties, as described below, to the properties file.

To increase the default timeout:

  1. On the Zoomdata server, edit /etc/zoomdata/screenshot-service.properties.

  2. Update the following properties, specifying an appropriate number of seconds for <nnnn>:

    • screenshot.webdriver.timeout=<nnnn>
    • export.dashboard.screenshot.timeout.seconds=<nnnn>
  3. Save the properties file.

  4. Restart the Screenshot service. See Restarting Zoomdata Services.

Self-signed Certificate

If Zoomdata is running with a self-signed certificate, the Screenshot service must be configured to accept the lower-security certificate.

To configure the Screenshot service to accept the lower-security certificate:

  1. On the Zoomdata server, edit /etc/zoomdata/screenshot-service.properties.

  2. Update the following property as follows:

    driver.options=--headless,--disable-gpu,--hide-scrollbars,--no-sandbox,--allow-insecure-localhost
  3. Save the properties file.

  4. Restart the Screenshot service. See Restarting Zoomdata Services.

    This will pass the options to the ChromeDriver. The option list includes the default options normally passed to the driver, with the additional --allow-insecure-localhost option.

Upgrade Notes

After upgrading, the screenshots on the Home page may look different. This occurs if there has been a change in the screenshot aspect ratio. To make the screenshots look correct, make sure that the screenshot.daemon.enabled property in the zoomdata.properties file is set to true. Remember to restart the Zoomdata server service after the change (see Restarting Zoomdata Services).

After you have updated the properties file, you can update the screenshots in one of the following ways:

  • In the zoomdata.properties file, modify the screenshot.daemon.schedule.rate property and set it to a more frequent refresh rate.

  • Execute a cURL call to update a screenshot for a specific dashboard.

  • Execute a cURL call to upload a custom image for a specific dashboard. Otherwise, the screenshots will be updated when the refresh screenshot procedure runs according to the configured refresh rate.

Was this topic helpful?