Discovery Rules Syntax

This section describes the syntax of discovery rules. Discovery rules are supplied in an XML file. Some examples are presented here, and detailed descriptions explaining the syntax in these examples follow.

Example 1

The following rule sets attribute vendor to hewlett_packard_co for CIs with the discovered_model attribute equal to HP2140.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules:normalization-rules name="My rules" xmlns:rules="http://www.hp.com/ucmdb/1-0-0/NormalizationRules">
<rules:normalization-rule ci-type="node" id="1">
<rule-input>
<attribute name="discovered_model" value="HP 2140" compare-type="equals"/>
</rule-input>
<rule-output>
<attribute name="vendor">
<value>hewlett_packard_co</value>
</attribute>
</rule-output>
</rules:normalization-rule>
</rules:normalization-rules>

Example 2

The following rule appends desktop to the node_role attribute list when a discovered node CI is connected to interface whose mac_address starts with 0020C0.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules:normalization-rules name="My rules" xmlns:rules="http://www.hp.com/ucmdb/1-0-0/NormalizationRules">
<rules:normalization-rule ci-type="node" id="3481">
<rule-input>
<connected-ci link-type="composition" direction="forward" end-type="interface">
<connected-ci-attribute name="mac_address" value="0020C0" compare-type="starts-with"/>
</connected-ci>
</rule-input>
<rule-output>
<attribute name="node_role">
<values>
<add>desktop</add>
</values>
</attribute>
</rule-output>
</rules:normalization-rule>
</rules:normalization-rules>

Example 3

The following example sets the values of os_description, os_vendor, os_family attributes and appends desktop and nt to the node_rule attribute when a discovered node CI has the discovered_os_name starting with Windows 2000 Professional.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules:normalization-rules name="My rules" xmlns:rules="http://www.hp.com/ucmdb/1-0-0/NormalizationRules">
<rules:normalization-rule ci-type="node" id="2">
<rule-input>
<attribute name="discovered_os_name" value="Windows 2000 Professional" compare-type="starts-with"/>
</rule-input>
<rule-output>
<attribute name="os_description">
<value>windows_2000_professional</value>
</attribute>
<attribute name="os_vendor">
<value>microsoft_corp</value>
</attribute>
<attribute name="os_family">
<value>windows</value>
</attribute>
<attribute name="node_role">
<values>
<add>desktop</add>
</values>
</attribute>
<class-type>nt</class-type>
</rule-output>
</rules:normalization-rule>
</rules:normalization-rules>

Example 4 (link rules)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules:normalization-rules name="My rules" xmlns:rules="http://www.hp.com/ucmdb/1-0-0/NormalizationRules">
<rules:normalization-rule id="2909" ci-type="containment">
    <link-rule-input>
         <attribute name="name" value="MyName" compare-type="starts-with"/>
          <end1 ci-type="node">
             <attribute name="description" value="MyDescription" compare-type="starts-with"/>
          </end1>
         <end2 ci-type="ip_address">
              <attribute name="name" value="1.1.1.1" compare-type="starts-with"/>
         </end2>
    </link-rule-input>
    <rule-output>
         <attribute name="description">
              <value>HP StoreOnce B6000</value>
        </attribute>
     </rule-output>
</rules:normalization-rule>
</rules:normalization-rules>

Explanation of Examples

Related Topics Link IconRelated Information