Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Create a Discovery process classification

Create a Discovery process classification

A process classification allows Discovery to create a particular CI type from information gathered during the identification and exploration phases.

About this task

When a process matches the classification criteria, Discovery uses the process classification record to create a CI. You can also have Discovery update existing CIs or ignore certain processes by creating a process handler.

Procedure

  1. Navigate to Discovery Definition > CI Classification > Processes.
  2. Click New.
  3. Enter the classification fields (see table).
    Table 1. Classification fields
    Field Input value
    Table Select the table where this classification generates CI records. This table must be an extension of the Applications [cmdb_ci_appl] table.
    Relation type Select the CI relationship type for this classification. The relationship field is only available for Process and Scan Application classifications.

    Discovery process classifications typically use one of these relationship types:

    • Runs on::Runs: Defines the relationship of an application to the host on which it runs. This relationship is expressed from the perspective of the host and the application. For example: My database application runs on server001::server001 runs my database application.
    • Depends on::Used by: Defines the relationship of an application that communicates with another application. This relationship is expressed from the perspective of each application. For example: The Tomcat application depends on the MySQL database:: The MySQL database is used by Tomcat.
    • Virtualized by::Virtualizes: Defines the relationship of a virtual machine to its host. This relationship is expressed from the perspective of the virtual machine and of the host. For example: server001 is virtualized by Server ESX::Server ESX virtualizes server001.
    Active Select this option to enable the process classification record. Only active process classifications can create application CI records.
    Order Enter the order in which Discovery should run this process classification when there are multiple classifications available for a table. Discovery runs process classifications from the lowest to highest order.
    Test with Lists the host CI where an automatically generated process classification conditions were met. Use this field to test changes to the process classification to ensure that the updated classification behaves as expected.
    Condition

    Use the condition builder to create the match and classification criteria for the process classification. This field replaces both the Match criteria field and Classification Criteria related list. The upgrade process converts all existing classification criteria into conditions.

    Note: Condition filters in process classifiers are case-sensitive.
    On classification script Enter a script to run when the condition and classification criteria are met. Use this script to perform any special tasks after a device is classified. It is possible to use the g_probe_parameters hashmap from within a classification script to set probe parameters for any configured, triggered probes. For example, this code sets a 'node_port' parameter to 16001 for all triggered probes.

    g_probe_parameters['node_port'] = 16001;

    See On classification script objects for Discovery for more examples and for a list of the objects you can use in this kind of script.

    Triggers probes Select the exploration probes you want Discovery to launch. These probes gather detailed information about a classified CI. Discovery will not launch these probes if it is configured to stop after classification. If you want to use patterns for horizontal discovery, add the Horizontal Pattern probe in the Probe column, and then specify your pattern in the Pattern column.
    Warning: Do not specify your pattern in Probe column. You must chose the Horizontal Pattern probe, which launches the specified pattern.
    Applications Use this related list to view the application CIs that match this process classification.
    Test results Use this related list to view the how Discovery classifies processes on the Test with host and build better classification conditions.
    Parameters Use this related list to view the parameters associated with this process and build better classification conditions. See Discovery classification parameters for a list of the parameters you can use.
    Versions Use this related list to view previous versions of the process classification record.
  4. Right-click the header bar and click Save.
  5. Enter items from related lists.
  6. Click Update.

Example

Figure 1. An example process classification record

On classification script objects for Discovery

Use an On classification script in a process classifier to customize an application record. This kind of script is used in a process classifiers.

Renaming the default application name

By default, application names are in this format: <name of the process classifer>@<the name of the computer CI where the process resides>;

For example, for a MySQL server running on a computer called machineA, the application is named mysql@machineA.

You can use the On classification script field in the process classifier record to change the default application name to match your business needs. For example, the following script changes the default application name to include a suffix after the process classifier:

var computerName = g_sensor.deviceGR.name;
var processClassiferName = g_classification.name;
current.name = processClassiferName + "999" + "@" + computerName;
In this example, the name of the application record becomes mysql999@machineA.
Another common technique is to set the application name based on the name, command, and parameter variables. For example, an Eclipse process might have the following values in these variables:
name "eclipse"
command "/glide/eclipse/Eclipse.app/Contents/MacOS/eclipse"
parameter "-psn_0_1884620"
If an Eclipse application runs on a computer called machineA, ServiceNow names the application eclipse@machineA. The following script appends the parameter value as part of the application name.
var computerName = g_sensor.deviceGR.name;
var processClassiferName = g_classification.name;
current.name = processClassiferName + parameters + "@" + computerName;
In this example, the name of the application record becomes eclipse-psn_0_1884620@machineA.

Sometimes it is useful to pass values to the triggered probes in the process classification. You can do this by creating a custom script that defines a name/value pair for the g_probe_parameters object. For example:
g_probe_parameters['processCommand'] = command;

In this example, when a classification record triggers a probe, the script passes the probe a parameter called processCommand with the value of the command variable.

Script objects

Use these objects in the script:
Script object Description
current Points to a JavaScript object with its [property:value] pair to update the application record. (It is not an actual GlideRecord object of the application.)
g_sensor Points to the running process sensor class. This object contains a deviceGR object, which points to the computer CI record on which the process resides.
g_classification Points to the process classifier record itself.
name Points to the process name.
command Points to the process command.
parameters Points to the process parameters.
g_probe_parameters A JavaScript object that will allow parameter passing to the triggered probes.

Create a Discovery process handler

Process handlers prevent the creation of duplicate CIs by filtering out parameters known to have inconsistent values before process classification occurs. You can create new classifiers or edit existing ones.

  1. Navigate to Discovery Definition > CI Classification > Process Handlers.
  2. Click New.
  3. Complete the fields on the Process Handler form.
    Table 2. Process Handler form
    Field Description
    Name Enter a unique name for the process handler record.
    Active Select the check box to run the process handler.
    Classify
    • Select the check box to enable classification of any Running Process [cmdb_running_process] record that matches this Process Handler's conditions.
    • Clear the checkbox to disable classification of any Running Process [cmdb_running_process] record that matches this Process Handler's conditions.
    Condition Select the conditions that trigger the process handler to run the script. In most cases, this condition contains either specific executable names or the presence of certain parameters.
    Script Enter the JavaScript you want to run on the current record in the Running Process [cmdb_running_process] table when the Condition is met. The current variable is a reference to a Running Process GlideRecord. The script should examine current.parameters for certain values, perform string replacement to manipulate these values, and save the result to current.key_parameters.

    ServiceNow uses the key_parameters field, together with the process name, to determine whether the process is unique on a specific machine.

    See On classification script objects for Discovery for additional options.
  4. Click Submit.