Server Management Suite

 View Only
  • 1.  Query to find all targets associated with policies

    Posted Jun 11, 2012 10:15 AM

    We are migrating from Altiris 7.0 to 7.1.  We found out that monitoring policy targets do not get migrated over if you have custom targets.  We have A LOT of custom targets.  Does anyone know of a query that will show us all targets and their associated monitor policy that they are a part of?  If not, maybe a query that is close that could set me on my way to building such a query?  Thanks.



  • 2.  RE: Query to find all targets associated with policies
    Best Answer

    Posted Jun 11, 2012 12:35 PM

    This should get you started:

     

    SELECT nri.Name [Monitor Policy], ri.Name [Resource Target]
    FROM vNonResourceItem nri
    JOIN vResourceTargetUses rtu
       ON rtu.ItemGuid = nri.Guid
    JOIN vNonResourceItem ri
       ON ri.Guid = rtu.ResourceTargetGuid
    WHERE nri.ClassGuid = '0821A65B-5338-464C-824D-9F7CEC48EA56' --Monitor Policies


  • 3.  RE: Query to find all targets associated with policies

    Posted Jun 11, 2012 05:48 PM

    That is very helpful thank you.  I added some more to the query to find the actual target computers as well as the target filters:

     

     

    SELECT nri.name [Monitor Policy], vc.name [Resource Target]
    FROM vNonResourceItem nri
    JOIN vResourceTargetUses rtu
      ON rtu.ItemGuid = nri.Guid
    JOIN vNonResourceItem ri
      ON ri.Guid = rtu.ResourceTargetGuid
    JOIN targetfilter tf
      ON tf.resourcetargetguid = rtu.resourcetargetguid
    JOIN targetfilterresource tfr
      ON tfr.targetfilterguid = tf.guid
    JOIN vComputer vc
      ON tfr.resourceguid = vc.guid
    WHERE nri.ClassGuid = '0821A65B-5338-464C-824D-9F7CEC48EA56' --Monitor Policies
    UNION ALL
    SELECT nri.Name [Monitor Policy], ri.Name [Resource Target]
    FROM vNonResourceItem nri
    JOIN vResourceTargetUses rtu
       ON rtu.ItemGuid = nri.Guid
    JOIN vNonResourceItem ri
       ON ri.Guid = rtu.ResourceTargetGuid
    WHERE nri.ClassGuid = '0821A65B-5338-464C-824D-9F7CEC48EA56' --Monitor Policies
    ORDER BY [Monitor Policy], [Resource Target]