How to use the CMDB task "Inventory Clean Up"

book

Article ID: 181680

calendar_today

Updated On:

Products

CMDB Solution

Issue/Introduction

 

Resolution

What the Inventory Clean Up task does

The CMDB task Inventory Clean Up is designed to do two things:
 

  • It removes all Inventory Solution data from computers. This will affect approximately 700 Inventory Solution database tables and removes all Inventory Solution Software and Hardware data for the processed computers. Note: It is not possible to configure this task to remove specific data classes, such as just Inventory Solution Software or just Inventory Solution Hardware. This is further discussed in the following related article:

    Can the CMDB task "Inventory Clean Up" only remove just Software or just Hardware data?
    http://www.symantec.com/business/support/index?page=content&id=HOWTO95109
     
  • If the processed computers were found to have Inventory Solution data, then after this data is removed, the processed computer's IsManaged data class to 0. Note: If the computer does not have Inventory Solution data, this task is then meaningless and will not set IsManaged to 0. If the customer needs to set this anyway to 0, this can be manually set in SQL by running the following SQL script in the SQL Server Management Studio:

    USE Symantec_CMDB
    UPDATE RM_ResourceComputer -- Or use RM_ResourceVirtual_Machine if the computer is a virtual machine asset type.
    SET IsManaged = 0
    WHERE Guid = '<GUID of the computer to be changed>'

    However, if there is still a Symantec Management Agent on the computer, within the hour, it will check into the Notification Server and IsManaged will be changed back to 1.
     

Retiring computers

If the purpose of using the Inventory Clean Up task is part of the retirement process for computers at the customer's company, this alone does not retire computers or remove the Symantec Management Agent or the Inventory plug-in. The following is a best practices article about how to retire computers:

Best practices for retiring a computer
http://www.symantec.com/business/support/index?page=content&id=HOWTO95111

How to configure the task

 

  1. In the Symantec Management Platform Console, click on the Manage button > Jobs and Tasks.
  2. Click on to expand the folders Service and Asset Management > CMDB.
  3. Click on the Inventory Clean Up task. 
  4. In the Asset Status field, click on the link or pencil to select the Status types to process. This can include any custom Status types. For example, "Retired, Disposed".
  5. In the "Include these resources" field, click on the link to select a filter to use if desired. This will only include the computers that appear on the selected filter and only if they also have one of the selected Status types from step 4. Notes: (1) In step 4, if the Status type of Retired is used, an inclusion filter cannot be used because filters, in general, do not enable Retired computers to appear on them. Instead, leave this blank, which will then process all computers but based on the selected Status types from step 4.  This is further discussed in the following article:

    CMDB task "Inventory Clean Up" fails to clear inventory data for Retired computers
    http://www.symantec.com/business/support/index?page=content&id=TECH214322

    Alternatively, the Status for Retired computers can be changed to something else temporarily, such as In Stock, and then the task ran against those. Once they are finished processing, their Status can be changed back to Retired, to enable an inclusion filter to be used.

    (2) Ensure that any filter used (including for step 6's exclusion filter, if used) has the expected computers to be processed and that its membership is updated. If not, then the task will not evaluate computers not on the filters for processing. Also, filters do not necessarily automatically update its membership. A custom automation policy can be created to force faster updates. The following article describes how to do this:

    How to create a new Update Filter Membership task to update a filter's membership
    http://www.symantec.com/business/support/index?page=content&id=HOWTO60948

    (3) For custom filters, if these do not work with the task, try an out of box filter or a new temporary custom filter with an specific SQL script to populate the exact computers to process. The following SQL script can be used in a filter for this purpose:

    SELECT va._ResourceGuid, vi.Name, va.Status
    FROM vAsset va
    LEFT JOIN vItem vi
    ON va._ResourceGuid = vi.Guid
    WHERE va.Status = 'Disposed' OR va.Status = 'In Stock' -- Add or remove Status types as necessary, including custom, with the exception of Retired, as this will not appear on a filter normally.
    -- Or, use a WHERE clause to specific exact computers, such as WHERE vi.Name = '<name of computer>'.
    ORDER BY 2

    Also, if filters are embedded with sub-filters, these could be problematic. Ensure that the filter used is a stand-alone filter to be sure that this is not an added issue.
     
  6. In the "Exclude these resources" field, click on the link to select a filter to use if desired. This will exclude computers that appear on the selected filter, regardless of if they have one of the selected Status types from step 4.
  7. Click on the "Save changes" button if any changes were made from the above steps.
  8. Click on the New Schedule button. Note: This task is not automatically set to run out of the box but must first be configured for use by the customer.
  9. Choose to leave the task at Now or set up a Schedule as desired.
  10. Click on the Schedule button.
  11. If the task was set to run Now, click on the Refresh button in the Task Status section. The task then appears in the list with its current progress. Depending on how many computers are being processed, this may take some time. Continue to monitor the task by clicking on the Refresh button. Note: Depending on the load of the Notification Server, this task may be deferred or slowed down by other running processes. Not all computers may be processed entirely immediately upon the task's "completion", therefore.
  12. Once the task completes successfully, computers can be spot checked in the following areas:

    a. In the Symantec Management Platform Console, review Resource Manager for a computer. On the home page, all of the Inventory Solution sections will be removed. Next, go to the Inventory page. In Inventory, open the Inventory folder. If Inventory Solution data has been completely removed, its folders, such as Hardware, Operating System, Software and User and Group, will no longer appear. Alternatively, review any Inventory Solution report that would also show this data, such as Reports > Discovery and Inventory > Inventory > Cross-platform > Software/Applications > Software > Installed Software by Computer.
    b. If Inventory Solution data has been successfully removed from a computer, its IsManaged value can next be checked. If not, then IsManaged will not have been changed, however. Run the following SQL script in the SQL Server Management Studio to check IsManaged's value:

    USE Symantec_CMDB
    SELECT Name, va.Status, IsManaged
    FROM RM_ResourceComputer rmrc -- Or use RM_ResourceVirtual_Machine if the computer is a virtual machine asset type.
    LEFT JOIN vAsset va
    ON rmrc.Guid = va._ResourceGuid
    ORDER BY 3, 1

    c. Review the Altiris Log Viewer for any errors that occurred during the task that may be relevant to further troubleshoot. For example, if computers are blacklisted, they are not expected to be processed by any task or policy. Errors will (but not necessarily) appear in the logs during tasks that attempt to process blacklisted computers. Ensure that the computers to be processed are therefore not in a blacklist. More information about this can be found in the following article:

    CMDB task "Inventory Clean Up" fails to clear inventory data for computers that are in a blacklist
    http://www.symantec.com/business/support/index?page=content&id=TECH199402

    d. Further troubleshooting can be performed by checking to see if the computers to be processed are valid targets of the task. If they do not have Inventory Solution data, they will not be processed. The filter Computers with Inventory Data can be used to check for valid targets or the following SQL script can be ran in the SQL Server Management Studio (which performs the same SQL script as the filter):

    USE Symantec_CMDB
    SELECT vc.[Guid], vi.Name 'Computer', Status, IsManaged
    FROM vRM_Computer vc
    JOIN dbo.Inv_Inventory_Results ir
    ON ir.Agent IN ('Inventory Agent', 'InvAgent.dll', '6.xInventory Agent')
    JOIN vItem vi
    ON vc.Guid = vi.Guid
    AND ir._ResourceGuid = vc.Guid
    JOIN vAsset va
    ON vc.Guid = va._ResourceGuid
    ORDER BY 2

    If the computers in question do not appear on this list, then it is not expected that they be processed by the Inventory Clean Up task.
     

Running the task in a hierarchy

CMDB and Asset Management are not supported in a hierarchy, nor do they support their data being replicated. This can result in several hierarchy-related issues therefore:
 

  • If CMDB is installed on the child, the task may or may not work. This is unsupported. Uninstall CMDB on the child, install it only on the parent and then run the task from that server.
  • If CMDB is installed on the parent, and the child replicates Inventory data from the child to the parent, this will clean the inventory from the target computers, but they will later be repopulated by the replicated Inventory data. CMDB has no control over this as this is working as the user has configured their replication rules. The customer may need to disable their Inventory replication rules then if this presents an issue for the task in being able to successfully, one time, remove Inventory data from the parent's records.


More information about this policy can be found in the following article:

Does Asset Management or CMDB Solutions support hierarchy and stand-alone replication rules?
http://www.symantec.com/business/support/index?page=content&id=HOWTO26021

Troubleshooting

If the Inventory Clean Up task fails to remove the inventory and set IsManaged to 0 for the expected computers, ensure the following is checked:

  • Were there any errors in the Symantec Management Console or Altiris server logs? If not, this generally indicates that the criteria for the expected comupters was not met. This could be then caused by:

    • The computer's Status was not one that was selected to be processed.
    • The computer was not in the Include filter, or, the computer was in the Exclude filter.
       
  • Make a new task, do not run an existing one, and schedule it to run Now. If that works but an older task does not, delete the older task and create a new one if the task is needing to be ran on a schedule.
  • Remove all Status types from the Asset Status field, save, then add back in just the Status of the expected computers. (Add more than one type) as necessary. Then, create a new task and run Now.