- NotificationAdderListener.zip
- Zipped directory with needed Node scripts + required modules
- serviceStatus.csv
- Example output
This NodeJS script does the following:
- Creates a Notification handle for any changes to the
ServiceStatus
Qlik Sense Repository entity filtered on only the Engine Service.POST /qrs/notification?name=ServiceStatus&filter=serviceType eq 3&changeType=2&PropertyName=timestamp
. For more details on the QRS Notification API refer to this blog post. - Creates a listener to receive the push notification configured in step 1.
- When it receives a notification, it does a
GET
operation on the specificServiceStatus
entity which belongs to an Engine Service who'stimestamp
value has changed. This can be due to the service restarting or due to the Qlik Sense Repository Service being unable to communicate with the Node's Engine Service. - Write the time at which the Engine went offline to
C:\Temp\serviceStatus.csv
- This configuration will not persist after upgrading Qlik Sense either by a full upgrade or patch. The
services.conf
file is expected to be reverted on any upgrade or patch operation.
- Unzip the directory into the install path for Qlik Sense (by default
C:\Program Files\Qlik\Sense
) such that there is a directory namedNotificationAdderListener
with a file inside calledserver.js
- Note: While this can be installed to any node, installing this to the Central node is encouraged.
- Example:
C:\Program Files\Qlik\Sense\NotificationAdderListener\server.js
- Ensure that script runs manually:
- Open up a command prompt with administrative rights
- Navigate to the installation path (e.g.
cd C:\"Program Files"\Qlik\Sense\
) - Change the directory to the
ServiceDispatcher
service (e.g.cd ServiceDispatcher
) - Launch the NodeJS script manually:
Node\node.exe ..\NotificationAdderListener\server.js
- Observe that it launches
- Wait 15 seconds
- Restart an Engine Service
notificationTime,hostname,serviceStatusTimestamp,serviceState
2019-05-29T17:46:49.685Z,qliksenserim02,2019-05-29T17:48:11.368Z,NoCommunication
- Configure script to initialize with the Qlik Sense Service Dispatcher service:
- Launch Notepad or similar text editor with administrator rights
- Open the
services.conf
file in the install path for Qlik Sense\ServiceDispatcher (e.g.C:\Program Files\Qlik\Sense\ServiceDispatcher\services.conf
) - At the very end, append with:
[notification]
Identity=qrs-notify
DisplayName=Notification Listener
ExePath=Node\node.exe
Script=..\NotificationAdderListener\server.js
- Restart the Qlik Sense Service Dispatcher service
- Wait 15 seconds
- Restart an Engine Service
notificationTime,hostname,serviceStatusTimestamp,serviceState
2019-05-29T17:46:49.685Z,qliksenserim02,2019-05-29T17:48:11.368Z,NoCommunication