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
warning
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. Verifying Configuration Application
- In the
Index Policies(Main menu-Settings-Index Management-Index Policies) policies are displayedsns-ism,continent-ism,continent-trash:

- In the
Managed Indexessection (Main menu-Settings-Index Management-Managed Indexes), the module indexes managed by the policies from step 1 are displayed::
| Index Name | Policy |
|---|---|
continent-clients-database-000001 | continent-ism |
continent-info-snmp-000001 | continent-ism |
continent-info-syslog-000001 | continent-ism |
continent-interface-info-snmp-000001 | continent-ism |
continent-interface-ip-snmp-000001 | continent-ism |
continent-interface-stats-snmp-000001 | continent-ism |
continent-ips-syslog-000001 | continent-ism |
continent-multiwan-snmp-000001 | continent-ism |
continent-pair_bond-snmp-000001 | continent-ism |
continent-sd-database-000001 | continent-ism |
continent-sd-snmp-000001 | continent-ism |
continent-sd-syslog-000001 | continent-ism |
continent-trash-syslog-000001 | continent-trash |
sns-mysql-entity_client-000001 | sns-ism |
sns-mysql-secretnetlog-000001 | sns-ism |
sns-mysql-serviceualog-000001 | sns-ism |
sns-syslog-000001 | sns-ism |
- In the
Templatessection (Main menu-Settings-Index Management-Templates) the module templates are displayed:

- In the list of directories
Directory List(Main menu-Lookup Manager-Directory List) the module directories are displayed:
- The
dim_continent_interface_iftypedirectory contains a list of interface types for equipment from theContinentfamily