Use > Inventory Tools > SAI Editor Overview > Application Teaching Overview > Rule-Based Application Teaching > Example of a Recognition Rule Using Installed Package Information

Example of a Recognition Rule Using Installed Package Information

When the Scanner is configured to collect Installed Applications file data, the Scanner can collect information as to which files belong to which installed packages. Using installed package recognition rules, files belonging to a particular package can be automatically recognized as belonging to a particular version of an application.

For more information, see the section describing the Hardware Data page in the Scanner Generator Wizard in the Data Flow Management Guide.

The following procedure shows you how to set up a recognition rule that matches a regular expression against installed package information.

To set up a Recognition Rule using installed package information:

  1. Open the SAI Editor.
  2. In the User SAI file, locate the application for which you want to create a rule– in this example, we will create a rule for tcl from ActiveState Software.
  3. If the application is not yet present in the file, you will need to add it.

  4. Right-click the application that you want to teach, and select Edit Application Rules.
  5. The Application Rules Editor opens.

  6. If the rule that you want to work with already exists, select it and click Edit. Otherwise, click Add.
  7. The Application Rule Wizard window opens

  8. Select Installed Package and click Next. The Application Rule Wizard opens.
  9. Follow these steps to specify the package name, type, and properties:
    1. Specify a Package name for a new rule or change the Installed Package Name as desired for an existing rule. The string you enter must match the package name exactly and is case sensitive. In this example, we use tcl.
    2. Select the Installed Package Type for this application. This is determined by the operating system on which the application runs.

      Oracle. If you want Universal Discovery to recognize Oracle components installed by the Oracle Universal Installer, click to select the Oracle check box, regardless of what operating system the Oracle components are installed on.

      Patch. If you want Universal Discovery to recognize patches, click to select the Patch check box. If you want Universal Discovery to recognize Windows APP package types, click to select the APP (Windows) check box.

      Note If you select the APP (Windows) option, you cannot edit the Recognize the application even if the package has no files option.

      App-V. If you want Universal Discovery to recognize virtual applications that are running under Microsoft Application Virtualization ("App-V"), select the App-V check box.

    3. Specify the Operating System for the application.
    4. Specify the Language for the application.
    5. Specify the Commercial license type for the application.
    6. Select Recognize the application even if the package has no files to recognize a package that does not contain files.
    7. Select the number of package occurrences to set the number of packages for a particular application version that reports one instance or version for that application. This setting is useful when multiple instances of the same application version are installed.

      Note In rare circumstances the same installed application (package) may be reported twice for a single installation of the application. In such a case set this value to two. The default value of 1 is appropriate in most cases.

  10. Click Next. The Package Rule page opens.
  11. Follow these steps to specify the regular expression for the release name:
    1. In the Field box, select the hardware field from which the release name will be obtained.
    2. In the Regular expression box, specify the regular expression to use. If the same field will be used to extract both the release and the version, the regular expression needs to be generic enough to provide groups that can match both names.
    3. The regular expression we will use for this example is as follows:

      ([0-9]+)\..*

      This expression represents a group of digits, followed by a period (dot), followed by any string. For additional information about and examples of regular expressions, see the section describing regular expressions in the Analysis Workbench part of this guide.

    4. In the Format field, specify how the release name will be formatted. You can enter a combination of text. For more macros, see the section on Macros in this guide.
    5. For the Regex Group Index, select the group from which the release name will be taken—or the entire field if the entire version field value is required. See Example of a Recognition Rule Using Version Data, step d in this guide for information about how to choose this value.
    6. For Mapping, you can enter some extra rules that will help identify applications. For example, you can enter the following to recognize different marketing names for the applications:
    7. 5.1=Windows XP

      5.2=Windows Server 2003

      6.0=Windows Vista

      In our example, we do not use this capability, as the release is a numeric value that does not require a mapping.

  12. Click Next to proceed.
  13. Follow the same procedure to specify the regular expression for the version name.
  14. The Regular expression box is only enabled if the version data field specified in the Field box is different from the one used to determine the release name. If it is the same and you need to amend the regular expression, click Back and edit it on the previous screen.

  15. Click Next. The following page will open if you have selected the Recognize the application even if the package has no files check box in step 6:
  16. Follow these steps to specify how the main file will be selected:
  17. You can specify the rule for the main file. Otherwise, the first file that is contained in the package is marked as the main file.

    In the Include Rule tab, you can specify file name, directory, and type to be included being selected as main file.

    Similarly, you can specify file name and directory to be excluded from being selected as main file in the Exclude Rule tab.

    Click Next to proceed

  18. On this page the Finish button becomes enabled. When no further matches are required, leave the radio button in the No further matches state, and click Finish to complete the wizard. Normally, however, it is necessary to specify extra conditions to ensure that the file comes from the expected publisher.
  19. In our example, we want to make sure that the publisher field refers to Red Hat Inc., which is the company we expect. If the tcl package happens to be used in another unconnected application for which the publisher is different, the rule will not be triggered.

    Note that the Field drop-down list only includes fields that have not previously been used for the release name, version name, or other extra matches.

  20. Click Finish to complete the rule configuration or Next to add another extra match.

Your new rule is now ready to be used for recognition. See the section entitled View Your New Rule to determine whether it successfully detected the installed package. The Package Rules tab shows all of the available installed package rules in the currently selected SAI.