Delete managed computers that have not reported basic inventory in a set number of days
search cancel

Delete managed computers that have not reported basic inventory in a set number of days

book

Article ID: 180818

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite Server Management Suite Asset Management Suite

Issue/Introduction

Managed computers that stop communicating with the Symantec Management Platform (SMP Server) stay in the Database (Symantec_CMDB). They keep appearing in Manage > Computers, in reports, and in target filters, and they can keep holding Inventory Solution licenses.

You want to remove managed computers that have not sent basic inventory in a set number of days. You also want to find managed computers that never sent basic inventory at all.

How can I delete computers from my SMP Server database based on the criteria of not receiving Inventory in a certain amount of time?

When to use this article

  • Manage > Computers lists computers that were decommissioned, reimaged, or renamed.
  • Inventory Solution shows more licenses in use than you have active computers. See Inventory Solution 8.x Troubleshooting Guide (Altiris).
  • Reports and target filters include computers that no longer exist on the network.

Environment

ITMS 8.7.x, 8.8.x

Cause

How it works

Each time the Symantec Management Agent (SMA or Altiris Agent) sends inventory, the SMP Server records the update in the ResourceUpdateSummary table. The table holds one row per computer per data class. The ModifiedDate column on that row is the last time the SMP Server received that data class for that computer.

Basic inventory includes the AeX AC Client Agent data class (9E6F402A-6A45-4CBA-9299-C2323F73A506). Purging Maintenance uses the ModifiedDate of this row to decide whether a computer has stopped reporting. See How Purge Maintenance Work on a Reporting Server.

Other data classes also write rows to ResourceUpdateSummary, including data classes the SMP Server updates on the server side, such as Active Directory Import data. See Troubleshooting AD Import issues. A query that takes the latest date across all data classes can show a computer as current even though its agent stopped reporting months ago. The query in this article reads only the AeX AC Client Agent row for that reason.

Where results differ

Situation

What happens

Reference

Managed computer never sent basic inventory

No AeX AC Client Agent row exists. Purging Maintenance does not retire or delete it. The query in Option 2 lists it as "Never received."

KB 439428

Computer was imported from Active Directory and never had the agent

The computer is not managed (IsManaged = 0). Purging Maintenance does not touch it, and the query does not list it. Use Active Directory Import synchronization instead.

KB 228171, KB 181580

Deleted computer still has a working agent

The computer is recreated the next time it checks in. A retired computer returns to Active status.

KB 152929

Reporting SMP server in a hierarchy

If the AeX AC Client Agent data class is not forwarded to the reporting server, Purging Maintenance on that server cannot identify computers to purge.

KB 439428, KB 178563

Console shows a different basic inventory date

In ITMS 8.7.1 and later, the console reads the basic inventory date from Inv_AeX_AC_Client_Status, not from the AeX AC Client Agent row. The two dates can differ.

KB 272134

Resolution

Use Option 1 to retire or delete stale computers on a schedule.
Use Option 2 to see which computers a threshold affects before you enable deletion, and to find managed computers that never sent basic inventory.
Use Option 3 to delete specific computers by hand.

Option 1: Purging Maintenance (recommended)

  1. In the Symantec Management Console, click Settings > Notification Server > Purging Maintenance.
  2. In the left pane of the page that opens, click Purging Maintenance.
  3. Go to the section Purge computers managed by this NS, which have not reported data for:.
  4. Set the number of days after which computers are retired, deleted, or both.
  5. Save the changes.

Retire sets the computer to the non-active status of Retired. Delete removes the computer from the CMDB. See Setup Purging Maintenance

Note: Purging Maintenance acts only on managed computers (IsManaged = 1) that have an AeX AC Client Agent record. It does not remove managed computers that never sent basic inventory. Use Option 2 to find those computers.

 

Note: In a hierarchy, the Purge Computers check box under Hierarchy Properties on the parent SMP controls whether a child SMP can keep its own purge settings. See How Purging works in a Hierarchy.

Before you enable Delete, run the query in Option 2 with the same number of days. The query shows which computers the setting affects.

Option 2: List stale and never-reported computers with SQL

The query reads the same data class that Purging Maintenance uses. It also returns managed computers that never sent that data class.

  1. Open SQL Server Management Studio on the SQL Server that hosts the SMP database.
  2. In Object Explorer, select the SMP database (by default, Symantec_CMDB), and then click New Query.
  3. Paste the following query.

    /*

    Managed computers whose AeX AC Client Agent data has not updated in @days days,

    plus managed computers that never reported this data class.

    Never-reported computers appear first, then the oldest dates.

    */

    DECLARE @days int = 30;   -- set to your Purging Maintenance threshold

     

    SELECT  c.Guid,

            c.Name                                       AS [Computer Name],

            CASE WHEN rus.ModifiedDate IS NULL

                 THEN 'Never received'

                 ELSE 'Stale' END                        AS [Status],

            rus.ModifiedDate                             AS [Last Client Agent Data Received],

            DATEDIFF(DAY, rus.ModifiedDate, GETDATE())   AS [Days Since Last Report],

            c.CreatedDate                                AS [Resource Created Date]

    FROM    vComputerResourceEx c

    LEFT JOIN dbo.ResourceUpdateSummary rus

            ON  rus.ResourceGuid = c.Guid

            AND rus.InventoryClassGuid = '9E6F402A-6A45-4CBA-9299-C2323F73A506'  -- AeX AC Client Agent

    WHERE   c.IsManaged = 1

      AND  (rus.ModifiedDate IS NULL

            OR rus.ModifiedDate < DATEADD(DAY, -@days, GETDATE()))

    ORDER BY rus.ModifiedDate ASC;   -- NULLs (never received) sort first

  4. Change @days to the number of days you use in Purging Maintenance.
  5. Run the query.

Query output

Column

Meaning

Guid

Resource GUID of the computer

Computer Name

Name of the computer resource

Status

"Never received" if the computer has no AeX AC Client Agent record. "Stale" if the record is older than @days days.

Last Client Agent Data Received

ModifiedDate of the AeX AC Client Agent record. Purging Maintenance uses this date.

Days Since Last Report

Days between the last AeX AC Client Agent update and today. Blank for "Never received."

Resource Created Date

Date the computer resource was created in the CMDB

 

Caution: Before you delete a "Never received" computer, check Resource Created Date. A computer created in the last few hours or days may have a new agent that has not sent basic inventory yet.

 

Note: The Last Client Agent Data Received date can differ from the basic inventory date shown in the console. See Basic Inventory last received information is not updated in the SMP Console.

 

Why the query can list more computers than Purging Maintenance

Purging Maintenance applies filters that this query does not:

  • It skips resource items marked as deleted.
  • It applies an additional resource association filter.
  • On a parent SMP, it limits results to computers that this SMP owns.

As a result, the "Stale" list can include computers that Purging Maintenance does not act on. Review the list before you delete computers by hand in Option 3.

Option 3: Delete specific computers by hand

  1. In the Symantec Management Console, click Reports > All Reports.
  2. In the left pane, right-click the folder where you want the report, click New > Base Report, and then set Report type to SQL Report.
  3. Paste the query from Option 2 into the SQL section, set @days, and save the report.
  4. Run the report.
  5. Select the computers you want to remove, right-click, and then click Delete. If Delete does not appear, configure the drilldown in the next section.

Enable right-click actions in the custom report

In ITMS 8.x, Delete and the other right-click context menu actions do not appear automatically for records in a custom SQL report. You configure them in the report's Drilldowns settings.

    1. In the Symantec Management Console, go to your custom report.
    2. Select the report, and then click Edit.
    3. Click the Drilldowns tab.
    4. If a default drilldown is listed (for example, ShowContextMenu), make sure it matches the settings in step 5. If no drilldown is listed, click Add.
    5. Configure the drilldown with these settings:

      Setting

      Value

      Name

      Action (Delete)

      Available On

      NewView

      Event

      Right-click

      Performs

      Show context menu



    6. Under Action Configuration, select the Standard item context menu check box.
    7. Click Save changes.

Verification

  1. Run the query in Option 2 again. Computers you deleted no longer appear.
  2. In Manage > Computers, search for a few of the deleted computer names. They no longer appear.
  3. If a deleted computer reappears later, its agent is still installed and communicating. Check the computer before you delete it again.

Additional Information

Computers due for retire or delete by Purging Maintenance: query with projected dates

Setup Purging Maintenance

How does purging maintenance work in Symantec Management Platform?

How Purging works in a Hierarchy

How Purge Maintenance Work on a Reporting Server

Active Directory Import Synchronization functionality

Basic Inventory last received information is not updated in the SMP Console

Inventory Solution 8.x Troubleshooting Guide