tw_pattern_management


The tw_pattern_management utility enables you to upload a TKU or pattern modules to the appliance, activate or deactivate pattern modules on the appliance, and remove pattern modules that are no longer required. You can perform these operations on knowledge uploads (Technology Knowledge updates (TKUs)), individual pattern modules, or files.

Recommendation

Use the BMC Discovery user interface, or the REST API to perform the functionality provided by the tw_pattern_management command line utility (see Knowledge-management). If you choose to run the utility, read the documentation in this section to learn its usage and to understand the risks and potential impact on your environment.

  • Pattern—A sequence of commands written in the Pattern Language (TPL), which contain instructions that identify scanned entities which are then used to create the BMC Discovery data model.
  • Module—A text file written in TPL which contains one or more patterns.
  • Knowledge uploads—Typically, these are TKU zip files that include:
    • Zip archives of patterns
    • Hardware Reference Data (HRD) files
    • Device RPMs
    • Product Content RPMs

Options in the utility specify the actions to be performed. To use the utility, type the following command:

tw_pattern_management [options] <upload/[upload:]module/file>  

where:

  • upload/[upload:]module/file is a knowledge upload name, a pattern module identifier, or an existing file. The necessary format to specify a pattern module is upload name:pattern module name. You can use shell parameter expansion to upload multiple matching files or all files in the current directory.
  • options are any of the options described in the following table and the common command line options described in Using-command-line-utilities.

Command Line Option

Description

--activate-all

Activate all pattern modules

--activate-module

Activate a specific pattern module

--activate-upload

Activate pattern modules within knowledge upload

--allow-restart

Allow services restart (if needed) to update Network Devices or Product Content.

--deactivate-module

Deactivate a specific pattern module

--deactivate-upload

Deactivate pattern modules within knowledge upload

-f, --force

Deactivate patterns before they are removed

--install

Install pattern modules within knowledge upload. It does not activate the pattern modules.

--install-activate

Install and activate pattern modules within knowledge upload

-l, --list-uploads

List knowledge uploads

--remove-all

Remove all pattern modules

--remove-module

Remove a specific pattern module

--remove-upload

Remove the knowledge upload

--show-progress

Display the progress of the operation


Recommendation

To understand TPL patterns and how they might function in your environment, refer to Configipedia, BMC's community website that facilitates knowledge sharing around TPL patterns. Configipedia also provides visibility of the Technology Knowledge Update release schedule and contents.

Recommendation

If you build your own zip archives of patterns, make sure they comply with the standard zip format. Other formats will not work.

User examples

In the following examples, type the commands on a single line. Line breaks are provided to make the examples easier to read.

Uploading and activating several patterns within a knowledge upload

You can upload and activate several patterns as a knowledge upload by specifying the knowledge upload name and using the --install-activate option. To upload and activate several patterns:

  1. Change to the directory containing the TPL zip archives.

    tideway@appliance01 ~] $ cd tmp
    tideway@appliance01 tmp] $ ls
    UploadA.zip  UploadB.zip 
  2. Use the utility to upload patterns (providing the password for the system user to run the command):

    tideway@appliance01 tmp] $ tw_pattern_management --install-activate *
    password:
    Uploaded UploadA.zip as knowledge upload "Upload A"
    Uploaded UploadB.zip as knowledge upload "Upload B"
    Knowledge uploads "Upload A", "Upload B" activated
    tideway@appliance01 tmp] $ 

Uploading, installing and activating a TKU

You can upload, install, and activate a TKU by specifying the knowledge upload name and using the --install-activate option. To permit the installation to restart the appliance, use the –-allow-restart option. To upload, install, and activate a TKU:

  1. Change to the directory containing the TPL zip archives.

    tideway@appliance01 ~] $ cd tmp
    tideway@appliance01 tmp] $ ls
    Technology-Knowledge-Update-3067-09-1-ADDM-11.2+.zip
  2. Use the utility to upload patterns (providing the password for the system user to run the command):

    tideway@appliance01 tmp] $ tw_pattern_management --install-activate --allow-restart Technology-Knowledge-Update-3067-09-1-ADDM-11.2+.zip
    password:
    ...
    tideway@appliance01 tmp] $ 

Deactivating a pattern module

You can deactivate a pattern module by specifying the pattern module name and using the --deactivate-module option. To deactivate a pattern module, type the following command (providing the password for the system user):

tideway@appliance01 ~] $ tw_pattern_management --deactivate-module "Host.ComputerSystem"
password:
1 pattern module deactivated
tideway@appliance01 ~] $ 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*