Question: How do I build a CA Client Automation Query to display agents where the collect task status is 'Waiting'?
Environment:
CA Client Automation - All Versions
Answer:
The steps below will help to get the correct number of agents with the collect task status - 'Waiting'
1. In the Query Designer, click on 'Advanced Argument':
<Please see attached file for image>
2. Enter the following values:
Pseudo text : Put a text eg: Inventory Configuration in Waiting
Table : -Any-
Additionnal WHERE clause :
SELECT object_uuid FROM (SELECT M.object_uuid, M.moname,M.agent_name,s.status, s.stcount, dateadd ( ss, stdate + datediff(ss,getutcdate(),getdate()), convert(datetime,'19700101')) 'Last Executed' FROM (SELECT DISTINCT m.moname,a.agent_name,a.object_uuid,m.moid, m.domainid FROM ncmodcfg m, linkmod l, ca_agent a WHERE m.moname like 'Inventory Configuration' and l.moid=m.moid and l.mdomid=m.domainid and ( (a.object_uuid=l.object_uuid and l.object_type=1) OR (l.object_type=0 and a.object_uuid in (SELECT m.member_uuid FROM ca_group_member m WHERE m.group_uuid=l.object_uuid)))) AS M LEFT JOIN statmod s ON (s.moid=M.moid and s.mdomid=M.domainid and s.object_uuid=M.object_uuid)) as M2 WHERE status=-1 OR status is NULL
Put the query in a single line. Do not cut it with carriage return. Replace 'Inventory Configuration' by the name of Inventory Configuration you want to query.
3. The query will look like below as shown in the screenshot:
<Please see attached file for image>
This should return the machines with a 'Waiting' status for the Inventory Configuration Module.
<Please see attached file for image>