Advanced configuration
This document provides comprehensive information about the introduction and concepts around Nexthink Chatbot SDK, its API and use cases. The information contained herein is subject to change without notice and is not guaranteed to be error-free. If you find any errors, please report them to us via Nexthink Support Portal. This document is intended for readers with a detailed understanding of Nexthink technology.
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
Changing global variables
Global variables can be changed manually by editing the /var/nexthink/nexthink-chatbot-adapter/.env
file
$ vi /var/nexthink/nexthink-chatbot-adapter/.env
Environment Variable | Description |
---|---|
| Chatbot SDK cache refresh frequency. The default value is 1h. Valid time units are |
| Requests per second limit for the cache database, Portal and each of the Engines. If this limit is surpassed, Chatbot SDK will return error 429. These variables are set to prevent an overload of the backend services. Default values are 500, 20 and 40. |
| Chatbot SDK logging level. The default value is 4 (Info). Valid values are:
|
| This variable controls the timeout for NXQL queries and the default value doesn’t have to be changed. Please refer to the Troubleshooting guide for more information. |
| This is the password for the existing PostgreSQL DB that serves as a cache for Chatbot SDK. The password is randomly generated during the installation process but can be modified if needed. |
Note that the PostgreSQL database used as cache is automatically managed by Chatbot SDK, and therefore there is no need to modify it.
If the password is manually modified in the file, the following additional steps will be required to update the user credentials in PostgreSQL DB. Until the containers are reloaded, service errors may occur.
USER_ACTIVITY_PERIOD
: Time in days used to filter devices populated in the local cache that were present during the defined period in the Engines. In order for the manual changes to take effect, the Docker containers must be reloaded.
Modifying the list of Engines
Engines are populated during the installation and can be updated. If you need to modify the list of Engines manually, you must change this file: /var/nexthink/nexthink-chatbot-adapter/config/engines.yaml
You can find the databaseUID
value by accessing the Portal API through the following endpoint: /api/configuration/v1/engines
$ curl -k https://:@/api/configuration/v1/engines
Engines must have a unique name.
In order to apply these manual changes, the Docker containers must be restarted.
$ ./scripts/nexthink-chatbot-adapter-restart.sh
This creates a new discovery process to refresh the local cache.
Increasing the log level
Logs are written in the standard output for each Docker container. You can read all of them as follows:
$ cd /var/nexthink/nexthink-chatbot-adapter $ docker compose logs
The log level is set in the Chatbot SDK .env file with a variable LOG_LEVEL
.
$ vi /var/nexthink/nexthink-chatbot-adapter/.env
To get the new log level, you must save the .env file with the new value and restart the Docker containers:
$ ./scripts/nexthink-chatbot-adapter-restart.sh
Nexthink local user configuration in Portal
It is recommended to create a specific Nexthink local account in Portal for Chatbot SDK. The user needs an authentication profile for remote actions API which can be set up in the Administration portal. The following scenario demonstrates how to setup up an admin_user profile:
Log in to the Portal as an admin.
Select the admin tab and then Profiles.
Create or edit an existing user profile.
Select none (full access) for Data Privacy in step 2.
Check Allow API of remote actions.
Modifying the discovery user_activity query
In some deployments, the user activity on a device is not reported on a regular basis. This may be related to General Data Protection Regulation (GDPR) compliance where the user activity feed is disabled. Also, it may be related to infrequent logins by the user.
In case the user activity is not being reported to Engine by Collector, Chatbot SDK will not include those devices in its cache. Since Chatbot SDK serves information relevant to the devices included in the cache, this can lead to the chatbot’s inability to interact with devices that are not a part of it.
By default, user activity is retrieved from user_activity
table. You can change it, however, to execution
table instead as described below:
The user activity query is defined in the configuration file /var/nexthink/nexthink-chatbotadapter/config/discovery.yaml
Any changes to the configuration file should be performed by a Nexthink specialist.
Default content:
Comment in one query and comment out the other one. After the next restart of the services, the discovery will start using the uncommented query.
If you need to customize the query, only change the filter part between the code marked as
#edit start
and#edit end
, leaving the fields selection as is.
Last updated