Skip to main content
Version: 5.3

Smart Code Task Integration for APKSH "Continent 4"

Integration of Smart Code tasks for APKSH "Continent 4" via API with Incident Manager is performed by the add_task_actions.py utility. The utility is provided in the smart_edr_ko_maker package, located in the bin directory and automates processes:

  1. Creating active actions in Smart Monitor for Smart Code tasks
  2. Generating a ready deployment package
  3. Preparing environment for executing Smart Monitor tasks as active actions

Installation Sequence

Running add_task_actions.py Utility

  1. In the smart_code_ko_maker builder, go to the bin directory
  2. Run the add_task_actions.py utility

Launch Parameters

Required parameters:

ParameterDescription
--sm_hostSmart Monitor host (one of the cluster nodes)
--sm_userSmart Monitor user
--sm_passwordSmart Monitor password

Optional parameters:

ParameterDefaultDescription
--sm_port9200Smart Monitor port

Complete Launch Example

python add_task_actions.py \
--sm_host open-search-host-1.my_company.ru \
--sm_user admin \
--sm_password password \
--sm_port 9200

Installing Active Actions

After executing the add_task_actions.py script, a build directory is created containing the following files:

  1. smart_code_actions.tar.gz - archive containing:
    • executable scripts (run_job_handler_continent.py, run_job_export_conf_or_backup_continent.py)
    • Python dependencies
  2. add_actions.sh - installation script

Sequence of actions:

  1. Transfer the contents of the build directory to the Smart Monitor Web server
  2. Transfer active actions:
Attention!

Executing commands will restart Smart Monitor Web.

chmod +x add_actions.sh
./add_actions.sh
systemctl restart opensearch-dashboards

Environment Preparation

Smart Code tasks are executed on the Smart Monitor Web server. To run active actions from the Smart Monitor interface, the following is required:

  1. Install Python 3.10+ on all data and master nodes
  2. Make the installed python interpreter system-wide
Attention!

Starting from version 5.1, Smart Monitor includes Python 3.12, which meets the requirements for executing active actions.

  1. Install libraries required for active actions:
    cd /app/opensearch-dashboards/config/actions
    pip install -r requirements_continent_api.txt

Checking Configuration Application

In the Active Actions section (Navigation Menu - System Settings - Module Settings - Incident Manager - Active Actions), Smart Code tasks are displayed with a set of required parameters:

Parameter Example