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:
- Creating active actions in
Smart MonitorforSmart Codetasks - Generating a ready deployment package
- Preparing environment for executing
Smart Monitortasks as active actions
Installation Sequence
Running add_task_actions.py Utility
- In the
smart_code_ko_makerbuilder, go to thebindirectory - Run the
add_task_actions.pyutility
Launch Parameters
Required parameters:
| Parameter | Description |
|---|---|
--sm_host | Smart Monitor host (one of the cluster nodes) |
--sm_user | Smart Monitor user |
--sm_password | Smart Monitor password |
Optional parameters:
| Parameter | Default | Description |
|---|---|---|
--sm_port | 9200 | Smart 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:
smart_code_actions.tar.gz- archive containing:- executable scripts (
run_job_handler_continent.py,run_job_export_conf_or_backup_continent.py) Pythondependencies
- executable scripts (
add_actions.sh- installation script
Sequence of actions:
- Transfer the contents of the
builddirectory to the Smart Monitor Web server - Transfer active actions:
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:
- Install Python 3.10+ on all
dataandmasternodes - Make the installed
pythoninterpreter system-wide
Starting from version 5.1, Smart Monitor includes Python 3.12, which meets the requirements for executing active actions.
- 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:
