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

Document ID : KB000017656
Last Modified Date : 14/02/2018
Show Technical Document Details


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?



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.



CA Client Automation - All Versions



  • 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".

    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

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.

Figure 3

Figure 4