How to create a CMDB rule that will assign Locations to computers

Article:HOWTO10037  |  Created: 2009-04-20  |  Updated: 2013-01-03  |  Article URL http://www.symantec.com/docs/HOWTO10037
Article Type
How To



A computer resource's Location field is not assigned by default. This requires a user to manually assign the Location. As there may be a large number of computers, a CMDB rule can be created to do this automatically on a schedule.

The following instructions provide an example of how to create a CMDB Rule that will assign Locations to computers. The provided SQL requires an identification of some type for the computer, such as what is at the beginning of the computer name. This can be adapted to match other criteria based on what the user wants to match up. For this example, this requires the following:

  • At least one computer that has a name starting with "AB". For example. "AB Test Computer".
  • A location named "AB Location".

Note: Instructions vary depending on if CMDB 7.x or 6.5 is used.

For CMDB 7.x:

  1. Click on the Settings button > All Settings.
  2. Click on Notification Server > Connector > CMDB Rules.
  3. Right click on CMDB Rules and then click on New > CMDB Rule.
  4. Click on "New CMDB Rule" (the Name field) and enter "Assign Computers with names starting with "AB" to the AB Location" as the value for the Name field.
  5. Click on "Add description" (the Description field) and enter "This rule will move all AB resources to the root of the AB Location based on the first two letters of the computer location name."
  6. Choose "Computer" for the "Resource type" field.
  7. Choose "SQL Query" for the "Target using" field.
  8. Enter the following in the "SQL query" field:

    SELECT i._ResourceGuid FROM Inv_AeX_AC_Identification i
    LEFT OUTER JOIN ResourceAssociation ra ON ParentResourceGuid = i._ResourceGuid
    AND ra.ResourceAssociationTypeGuid = '05DE450F-39EA-4AAE-8C5F-77817889C27C'
    WHERE i.[Name] LIKE 'AB%' AND ra.ParentResourceGuid IS NULL

    Note: Change the last line to be specific to what the match criteria should be.

  9. In Step 3: Add resource associations to  modify, locate Location.
  10. Choose <Value> for the "Lookup key" field.
  11. Click on "Select 'Location' reources" in the "Key column mapping" field.
  12. Click to select the Location to use, such as the "AB Location" example.
  13. Click on the OK button.
  14. Click on the Test rule button.
  15. After reviewing the test results, click on the Close button.
  16. If the rule worked, click on the Save changes button.
  17. The CMDB rule can now be ran or scheduled to run or ran manually as needed. After running the rule, editing a computer that is included in the SQL query from step 8 will now show that the Location is now "AB Location".

For CMDB 6.5:

  1. In the Altiris Console 6.0, click on the Configuration tab > Solution Settings > Connectors > CMDB Rules.
  2. Right click on CMDB Rules and then click on New > CMDB Rule.
  3. Enter "Assign Computers with names starting with "AB" to the AB Location" as the value for the Name field.
  4. Enter "This rule will move all AB resources to the root of the AB Location based on the first two letters of the computer location name." as the value for the Description field.
  5. Choose Computer as the "Resource type".
  6. Choose SQL Query for the "Target using" field.
  7. Enter the following in the "SQL query" field:

    SELECT i._ResourceGuid FROM Inv_AeX_AC_Identification
    LEFT OUTER JOIN ResourceAssociation ra ON ParentResourceGuid = i._ResourceGuid
    AND ra.ResourceAssociationTypeGuid = '05DE450F-39EA-4AAE-8C5F-77817889C27C'
    WHERE i.[Name] LIKE 'AB%' AND ra.ParentResourceGuid IS NULL

    Note: Change the last line to be specific to what the match criteria should be.

  8. Expand Step 3: Add resource associations to  modify.
  9. Under Forward Associations, locate Location.
  10. Choose <Value> for the Lookup Key field.
  11. Click on "Select resources" in the Key Column Mapping field.
  12. Click to select the Location to use, such as the "AB Location" example.
  13. Click on the OK button.
  14. Expand Step 5: Test or run CMDB rule.
  15. Click on the Test Rule button.
  16. After reviewing the test results, click on the Close button.
  17. If the rule worked, click on the Apply button.
  18. The CMDB rule can now be ran or scheduled to run or ran manually as needed. After running the rule, editing a computer that is included in the SQL query from step 7 will now show that the Location is now "AB Location".
     

Related Article

How to use the CMDB task Update Network Resource Location to assign Locations to computers based on the computer's subnet
http://www.symantec.com/business/support/index?page=content&id=HOWTO64412



Legacy ID



46677


Article URL http://www.symantec.com/docs/HOWTO10037


Terms of use for this information are found in Legal Notices