Zoomdata Version

Setting Up the Screenshot Microservice

The Screenshot microservice allows you to view the snapshots of your saved dashboards on Zoomdata's Home page. At this time, Zoomdata only supports 64-bit versions.

Screenshot Microservice Prerequisites

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

The Chrome-based Zoomdata Screenshot microservice 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.

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

Installing the Screenshot Microservice

The following manual steps are not required if the target server can already pull from a public (Chrome) repository.

To install the Screenshot microservice:

  1. Install the correct version of ChromeDriver. Refer to ChromeDriver documentation for more information.

    Run the script install-dependencies.sh (located in the /opt/zoomdata/docs/screenshot-service/ installation directory) or 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
  2. Download the Screenshot microservice package using the link provided by Zoomdata Technical Support.

  3. 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
  4. Optionally, modify the zoomdata.properties file to enable and set up the Screenshot microservice. In addition to enabling the Screenshot microservice, 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.

  5. 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.

  6. Enable and start the Screenshot microservice. 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 microservices is provided in Restarting Zoomdata Microservices.

  7. Watch the /opt/zoomdata/logs/screenshot-service.log file. The microservice 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 Microservice

To test the Screenshot microservice:

  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 microservice is operating correctly.

Troubleshooting Screenshot Microservice Problems

Common issues can be resolved by editing the Screenshot microservice 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 microservice. See Restarting Zoomdata Microservices. See also Icons Not Reverting to Defaults After Screenshot Microservice Disabled

Timeouts

Zoomdata and the Screenshot microservice 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 microservice 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 microservice. See Restarting Zoomdata Microservices.

Self-signed Certificate

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

To configure the Screenshot microservice 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 microservice. See Restarting Zoomdata Microservices.

    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 microservice after the change (see Restarting Zoomdata Microservices).

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?