How to generate a list of Patrol Agents within the TrueSight Presentation Server database with policies applied. Interested in a listing of all the Agents and their policies applied. There are two possible queries which have been tested and depending on the type of data needed, choose the query which meets your needs. This script will report historical data regarding policies: Windows: psql -U dbuser -d truesight -c "select a.patrolagentid,a.policiesconsidered,b.hostname from patrolagent_pcfgtl a left outer join patrolagent_details b on a.patrolagentid = b.patrolagentid order by b.patrolagentid" > \tmp\PA.txt Linux: ./psql -U dbuser -d truesight -c "select a.patrolagentid,a.policiesconsidered,b.hostname from patrolagent_pcfgtl a left outer join patrolagent_details b on a.patrolagentid = b.patrolagentid order by b.patrolagentid" > /tmp/PA.txt The script returns all policies ever associated with the Agent If you want to list the current active policies, please use the query below: Windows: psql -U dbuser -d truesight -c "select patrolagentid, POLICIESAPPLIED,hostname from PATROLAGENT_DETAILS group by patrolagentid, POLICIESAPPLIED ,hostname" > \tmp\PA.txt Linux: ./psql -U dbuser -d truesight -c "select patrolagentid, POLICIESAPPLIED,hostname from PATROLAGENT_DETAILS group by patrolagentid, POLICIESAPPLIED ,hostname" > /tmp/PA.txt |