Skip to main content
Version: 6.2

Installing and Initializing Inventory

Prerequisites​

The following files are required for installation:

  • archive with saf-inventory module files for OpenSearch
  • archive with safInventory module files for OpenSearch Dashboards

Installation Process​

Install the module on OpenSearch servers with the following command:

sudo -u opensearch $OS_HOME/bin/opensearch-plugin install file://<path to module archive>

Install the module on OpenSearch Dashboards servers with the following command:

sudo -u opensearch $OSD_HOME/bin/opensearch-dashboards-plugin install file://<path to module archive>
Update the build identifier

After installing or updating the plugin, increment build.number in $OPENSEARCH_DASHBOARDS_HOME/package.json. This clears the browser cache. Then restart the OpenSearch Dashboards service.

For details, see Installing Plugins.

Inventory Initialization​

To initialize the module, go to Main Menu - Settings - Module Settings - Inventory - Initialization:

Inventory Initialization

Integration with Search Anywhere Framework​

In the User field, enter the dedicated OpenSearch service account name.

warning

The Password field cannot be edited. Its value is stored in the OpenSearch keystore.

To integrate the Inventory module with Search Anywhere Framework, store the dedicated OpenSearch service account password in the inv.os.pass keystore key on nodes where the Inventory plugin is installed.

The account is used for license validation and when using the legacy calculation algorithm.

Adding a Password to the Keystore via API Request​

Open Main Menu - Settings - Dev Tools. To identify the nodes where the Inventory plugin is installed, run:

GET _cat/plugins?v&h=name,component,version

In the response, find the rows with sa-inventory in the component column and note the node names from the name column.

To view the keystore contents on the cluster nodes, run:

GET _core/keystore
Note

The nodeid parameter limits the request to the specified nodes. You can use a node name or a wildcard as its value. For details, see Managing the Keystore via API.

Add the key to the nodes with the Inventory plugin by specifying a node name or a common wildcard in the nodeid parameter:

POST _core/keystore/inv.os.pass?nodeid=<INVENTORY_NODE_NAME_OR_MASK>
{
"value" : "<OPENSEARCH_SERVICE_ACCOUNT_PASSWORD>"
}

Specify the dedicated OpenSearch service account password in the value field. If the nodes cannot be selected with a single wildcard, repeat the request for each node where the Inventory plugin is installed.

Adding a Password to the Keystore Manually​

Add the inv.os.pass key to the keystore on OpenSearch nodes where the Inventory plugin is installed with the following command:

sudo -u opensearch $OS_HOME/bin/opensearch-keystore add inv.os.pass

When prompted for the key value, enter the dedicated OpenSearch service account password. Restart the OpenSearch node after running the command.

Connecting to the System Database​

The updated calculation algorithm of the Inventory module works with a PostgreSQL system database. Installing PostgreSQL and creating a user and a database are described in PostgreSQL Configuration. Configure the connection in Main Menu - Settings - Module Settings - General - System database. Until the connection is configured, the Inventory initialization page shows a notice with a link to this section.

To configure the connection:

  1. Fill in the Host, Port, Database, User, and Password fields
  2. If needed, change the Connection timeout, s and Query timeout, s fields
  3. Click Check connection. The check runs on every cluster node. If a node cannot connect, the page shows the node and the reason
  4. Click Save

On save, the password is written to the OpenSearch keystore on all cluster nodes. If the Password field is left empty, the previous password is kept.

Node Execution Filtering​

By default, tasks run on all servers where the Inventory module is installed. Filters define the set of nodes used to run tasks. This setting is optional.

The following filter types are available:

  • Include — at least one condition must be met
  • Exclude — none of the conditions can be met
  • Require — all conditions must be met

The following attribute types are available:

  • Node Name
  • Host IP Address
  • Public Host IP Address
  • IP Address
  • Host Name
  • Node Identifier
  • Custom Attribute

In the Value field, enter the node attribute value.

note

When you use Custom Attribute, a field appears for its name:

Custom Attribute

Editing Inventory Settings​

After initializing the module, you can edit its parameters and add additional settings on the same tab.

Example of a completed form:

Inventory Settings

Adding a Section to the Main Menu​

To add the module component to the menu, navigate to Main Menu - System Settings - Management - Navigation - JSON. Add the JSON dictionary below to the data list.

Inventory Menu
{
"itemType": "group",
"name": "inventory",
"show": false,
"id": "39afa001-b528-4488-bd55-58b09c0bded9",
"title": "Inventory",
"sections": [
{
"itemType": "page",
"name": "inventory-configs",
"show": true,
"id": "f8518eba-cdf9-4341-bd14-51644f09c620",
"title": "Assets",
"enabled": true
}
],
"enabled": true
}

Manual moduleInventory Startup​

If necessary, you can start moduleInventory manually, for example, to verify the settings or update the asset database outside the schedule. Run only one module instance on one of the nodes where the Inventory plugin is installed.

Startup Parameters​

  • -v — display the version
  • -log — duplicate log output to the console
  • -with-index — use fast candidate search with partial similarity
  • -bulk-changes — send asset changes using bulk requests

Go to the directory containing the executable and run the command as the opensearch user:

cd $OS_HOME/utils/inventory
sudo -u opensearch ./moduleInventory -log -with-index -bulk-changes

To display the version, run:

sudo -u opensearch $OS_HOME/utils/inventory/moduleInventory -v