How to list machines on which the hardware inventory collect task has not been run in X days?
search cancel

How to list machines on which the hardware inventory collect task has not been run in X days?

book

Article ID: 17656

calendar_today

Updated On:

Products

CA Automation Suite for Data Centers - Configuration Automation CA Client Automation - Asset Management CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Remote Control CA Client Automation - Asset Intelligence CA Client Automation - Desktop Migration Manager CA Client Automation - Patch Manager CA IT Asset Manager CA Software Asset Manager (CA SAM) ASSET PORTFOLIO MGMT- SERVER CA Server Automation CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

Introduction:

I need to create a query to return all assets on which the hardware inventory collect task has not run in X days.                                                                               In the DSM Explorer, I can only create a query based on the status of the collect task, not it's last run date.

Is there a way to achieve this?

 

Background:

The query below can aid administrators troubleshooting agents that are having issues with the hardware scan

and help locate machine where agents are not sending data in X number of days.

This helps save time of having to look at the last run date under each agent in the CA Client Automation DSM Explorer screen.

 

Environment:  

CA Client Automation - All Versions

 

Instructions: 

  • Create a query using the Query Designer with 'Computer's as target as below:

    Collect Task 'Inventory Configuration', Status text = 'OK'
  • This will return computers on which the collect task has been run successfully.
  • In the Query Designer, right-click on the argument and select "Edit SQL".

    <Please see attached file for image>

    Figure 1
  • Add following string at the end, just before the closing bracket ')'.

Example for 5 days:
AND DATEDIFF(ss,'19700101',GETUTCDATE())-stdate>86400*5

<Please see attached file for image>

Figure 2

The query is updated to return machines which have not executed the collect task "Inventory Configuration" in 5 days.

Note: 86400 is the number of seconds in a day.

In the following screenshots, the query returns one machine on which the collect job has not run for more than 5 days.

The collect tasks listing shows that the inventory collection has not run on this machine since July 27, 2014.

<Please see attached file for image>

Figure 3

<Please see attached file for image>

Figure 4

Environment

Release: UASIT.99000-12.9-Asset Intelligence
Component:

Attachments

1558709573700000017656_sktwi1f5rjvs16riy.gif get_app
1558709571537000017656_sktwi1f5rjvs16rix.gif get_app
1558709569750000017656_sktwi1f5rjvs16riw.gif get_app
1558709567501000017656_sktwi1f5rjvs16riv.gif get_app