Configuring Inventory Processor
Settings Description
Inventory Processor is the executable module file responsible for populating the asset database. The standard executable file name is: moduleInventory-<version>.
Configuration File
To run Inventory Processor, a configuration file named config.yml must be present in the module folder. It contains the following parameters:
| Parameter | Description | Required |
|---|---|---|
opensearch | List of OpenSearch cluster servers. | Yes |
username | Username for connection. | Yes |
password | Password for connection. | Yes |
cert | CA certificate for authentication verification. | Yes |
join_events_with_null_value | Skip empty keys during the aggregation stage. | No |
include_assets | List of asset configurations requiring processing. If not specified, all configurations will be processed. | No |
Example config.yml content:
opensearch: ['https://172.16.0.60:9200']
username: 'admin'
password: 'pass'
cert: 'root-ca.pem'
join_events_with_null_value: false
include_assets:
- asset_name: 'Hosts'
search_fields: ['hostname']
If you need to hide the password from the Inventory configuration file, the username and password parameters can be omitted from the configuration file and specified via environment variables instead:
SM_INV_USERNAME and SM_INV_PASSWORD.
Environment variable values override parameters set in the configuration file. To pass environment variables to a cron job, define them in the /home/opensearch/.profile file and run the cron job via bash. Access to the /home/opensearch/.profile file should be strictly limited, allowing only the root user and the user running the service to read it.
Example crontab for the opensearch user:
* * * * * bash -l -c "cd /app/inventory; ./moduleInventory"
Example /home/opensearch/.profile:
export SM_INV_USERNAME=admin
export SM_INV_PASSWORD=VeryStrongPassword
Launch Parameters
The Inventory Processor executable supports the following launch parameters:
-v- display version-log- duplicate log output to console (optional)-with-index- fast search for partial similarity candidates (optional)-bulk-changes- send asset changes via bulk request (optional)
./moduleInventory -v
./moduleInventory -log -with-index -bulk-changes
./moduleInventory -with-index -bulk-changes
./moduleInventory