Prerequisites to connecting to Qlik Sense server

In order to connect to and authenticate against the Qlik Sense (QS) server, several requirements must be satisfied. For Qlik Sense, Metric Insights accesses the Qlik Sense server via the same ports and protocol that your users access Qlik Sense via web browser - port 80 (http), 443 (https). In addition, Metric Insights accesses Qlik Sense server via port 4747 for communication via Qlik Sense WebSocket API, and port 4244 for NTLM authentication.

This article describes the process of fulfilling these requirements:

  1. Creating a Qlik Sense client certificate
  2. Installing Java
  3. Installing a Remote Data Collector on the QS server
  4. Installing PhantomJS [2.0] on the QS server
  5. Configuring the Qlik Sense certificate on the Windows machine
  6. Creating a qliksense.conf file

1. Create a Qlik Sense certificate (on QS server in QMC)

Metric Insights uses a client certificate for authentication with the Qlik Sense server.

Instructions:

Go to your Qlik Sense server and sign into the QMC.

In the QMC, go to the Certificates page and fill in the following fields:

  1. Add machine name button
  2. Machine name - The value is not important and can be any non-empty string.
  3. Certificate password (Required). Important: Remember this value because you will need to enter it in Step #4 below.
  4. Export file format - Must be “Windows format." Note for Qlik Sense 1.1 you are not given this option
  5. Note the location that Qlik Sense will create the certificate (e.g., C:\ProgramData\Qlik\Sense\Repository\Exported Certificates)
  6. Export certificates button

Qlik Sense then creates the following certificate files: client.pfx, root.cer, server.pfx in the folder (e.g., in C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\<Machine name>\)

Note: Instructions for exporting a Qlik Sense certificate can also be found in the following Qlik Sense help article:   https://help.qlik.com/sense/2.0/en-US/online/#../Subsystems/ManagementConsole/Content/export-certificates.htm )

2. Install Java on the machine

Follow this link to download and install Java.

3. Install a Remote Data Collector

A Remote Data Collector must be used to avoid certain Qlik Sense specific issues, such as:

For step-by-step instructions refer to: Configure a Remote Data Collector

4. Install Phantom JS [2.0] on the QS server

Download PhantomJS here (download version 2.0 for Windows only)

Once downloaded, follow the steps below to install PhantomJS on Windows:

  1. Right click on the downloaded phantomJs zip file to Extract All
  2. Copy phantomjs.exe located in the phantomjs-2.0.0-windows\bin directory
  3. Create the following directory on C:\ drive: C:\PhantomJs\bin\phantomjs
  4. Paste phantomjs.exe in the new directory
  5. Copy the path of the new phantomjs directory (C:\PhantomJs\bin\phantomjs)
  6. Right click My Computer and select Properties
  7. Select Advanced system settings
  8. Click the Environment Variables button
  9. Under the System Variables section, find the Path variable
  10. Click the Edit button
  11. At the end of the existing Path, add a semicolon (;) then add the path to C:\PhantomJs\bin\phantomjs
  12. Click OK
  13. Run a quick test

Now, let’s confirm that PhantomJs is configured properly for Windows

  1. Open up Notepad and enter the following:
var page =require('webpage').create();var url ='http://www.metricinsights.com/';page.open(url,function(status){console.log(status);phantom.exit();});
  1. Save as phantomjsTest.js to your local C: drive
  2. Open a Windows Command Prompt, go to the directory where you saved phantomjsTest.js, then enter: phantomjs phantomjsTest.js
  3. You should see a status of success

5. Configure Qlik Sense certificate on your Windows machine

Continuing from the creation of the Qlik Sense certificate in Step #1, copy the certificates to the directories specified below for use by the Remote Data Collector. Note, if Qlik Sense is deployed on a cluster, copy the certificate files over to the machine where the Remote Data Collector is installed:

  1. Copy client.pfx from the Qlik Sense server to C:\PhantomJs\bin\phantomjs
  2. Copy root.cer from the Qlik Sense server to  C:\Program Files (x86)\Metric Insights
  3. Open a Windows Command Prompt, then run the keytool.exe as shown below then see step #4 for the passord:
C:\Program Files (x86)\Java\jre1.8.0_111\bin\keytool.exe" -keystore "C:\Program Files (x86)\Java\jre1.8.0_111\lib\security\cacerts" -importcert -alias qsnew10 -file "C:\Program Files (x86)\Metric Insights\root.cer
Command Component Description
C:\Program Files (x86)\Java\jre1.8.0_111\bin\keytool.exe path to the keytool script
keystore "C:\Program Files (x86)\Java\jre1.8.0_111\lib\security\cacerts" path to the keystore location
importcert Reads the certificate from the file root.cer, and stores it in the keystore entry identified by alias.
file "C:\Program Files (x86)\Metric Insights\root.cer" path to the Client Certificate "root.cer" location

4.  Enter keystore password: changeit

5.  File server.pfx is not needed.

6.  In file C:\Program Files (x86)\Metric Insights\Insightd\plugins\qliksense.conf update the client_key_pass value with the Certificate password value you entered when creating the certificate. Important: This is the value you specified in the Qlik Sense QMC in Step #1. 

6. Create qliksense.conf if it does not already exist.

  1. In C:\Program Files (x86)\Metric Insights\Insightd\plugins create a qliksense.conf configuration file
  2. Enter the following three parameters and provide values for them:
  • client_key_path: specify a path to the client.pfx certificate file. The certificate contains the public key. Identification with certificates involves a cryptographic operation to show, that you are in the possession of the secret private key matching the public key in the (public) certificate. This private key is contained in the .pfx file.
  • client_key_pass: define a password to client.pfx
  • path_to_phantom_js: specify a path to PhantomJS

Example:

client_key_path=C:\PhantomJs\bin\phantomjs\client.pfx
client_key_pass=cert-password
path_to_phantom_js=C:\PhantomJs\bin\phantomjs\phantomjs.exe

Metric Insights should now be configured to use the Qlik Sense certificate you created.

Optional commands for managing Qlik Sense certificate in Metric Insights

NOTE: if you want to delete keytool aliases created in step 3 above, then use the following commands:

List alias for root.cer in keytool:

"C:\Program Files (x86)\Java\jre1.8.0_111\bin\keytool.exe" -list -keystore "C:\Program Files (x86)\Java\jre1.8.0_111\lib\security\cacerts" 

Enter keystore password:  changeit

Delete alias for root.cer in keytool:

"C:\Program Files (x86)\Java\jre1.8.0_111\bin\keytool.exe" -delete -alias qsnew10 -keystore "C:\Program Files (x86)\Java\jre1.8.0_111\lib\security\cacerts"

Enter keystore password:  changeit

Next: Collecting data. Once setup, pulling data from Qlik Sense is easy. You configure data connection in Metric Insights, then begin collecting data.

0 Comments

Add your comment

E-Mail me when someone replies to this comment