Installing Configurations
The first stage is designed to automate the deployment and configuration of dependent objects for the Smart Code module. Configuration is performed using the make_smart_code.py utility. The utility is provided in the smart_code_ko_maker package and located in the bin directory. The utility performs the following tasks:
- Deployment of knowledge objects (
Smart Monitorentities) - Creation of index templates
- Creation of indexes
- Deployment of ISM (Index State Management) policies
- Loading interface types from a CSV file
Requirements:
- Python 3.x
- Installed dependencies:
requests,urllib3 - Access to the
Smart Monitorcluster with administrator credentials
Utility Structure
The script contains the following directory structure:
./
├── data/ # Main directory with configurations
│ ├── sm_*/ # Directories with `Smart Monitor` entities (starting with sm_)
│ ├── index_templates/ # Index templates
│ ├── indexes/ # Index configurations
│ └── ism_policies/ # Index state management policies
└── lookups/
└── dim_continent_interface_iftype.csv # CSV file with interface types for "Continent" family equipment
File Formats
Index settings (indexes) and policies (ism_policies) are for demonstration purposes and must be adjusted to meet installation requirements regarding data rotation and replication configuration.
Smart MonitorEntities (insm_*directories): JSON files with metadata in the_metafield and a unique identifier- Index Templates (
index_templates):{
"name": "template_name",
"index_template": {
// template configuration
}
} - Indexes (
indexes):{
"index_name": {
// index configuration
}
} - ISM Policies (
ism_policies):{
"policy": {
"policy_id": "policy_name",
// remaining configuration
}
} - Interface Types (
dim_continent_interface_iftype.csv): Current list of interface types for equipment from theContinentfamily
Installation Sequence
1. Running Configuration Installation
Installation is performed by running the make_smart_code.py:
python make_smart_code.py --sm_host <host> --sm_user <user> --sm_password <password> [--sm_port <port>]
Command line parameters:
| Parameter | Required | Type | Default Value | Description |
|---|---|---|---|---|
--sm_host | Yes | str | - | Smart Monitor host (one of the cluster nodes) |
--sm_port | No | int | 9200 | Smart Monitor port |
--sm_user | Yes | str | - | Username |
--sm_password | Yes | str | - | User password |
Example execution:
python make_smart_code.py --sm_host open-search-host-1.my_company.ru --sm_user admin --sm_password securepassword --sm_port 9200
2. Checking configuration application
-
In the
Templatessection: (Navigation Menu-System Settings-Index Management-Templates) the module templates are displayed:

-
In the
Index patternssection: (Navigation Menu-System Settings-Module Settings-OPENSEARCH-Index patterns) the module index patterns are displayed:

-
In the lookup list
Lookup list: (Navigation Menu-Lookup Manager-Lookup list) the module lookups are displayed:
-
The
dim_continent_interface_iftypelookup contains a list of interface types of equipment from theContinentfamily