I was searching all around to see if there were any triggers or if I could do it by view and I didn't see anything. I just want a blanket out of compliance so if it is for any reason, I get an email.
Can you please provide an example of what you require
You can find the compliance of a machine using this SQL . It will return the Compliance Status for each Policy assigned to a machine
SELECT agentguid, [ComputerName] ,[GroupName] ,[OperatingSystem] ,[OSInformation] ,
So you could create the SQL xml file and then include it in an Agent Procedure using the SQLRead command and save result to a variable and then update a custom field with the result
The actual line in the xml file would need to look like this where you pass to the script the name of the Policy you want to check using a variable declared as #PolicyName# within the script.
<queryDef label="Select MachineCompliance" sql="SELECT [policyStatus] FROM [ksubscribers].[policy].[vPolicyAgentStatusRpt] where policyName = '#PolicyName#' and agentguid = '#vmachine.agentguid#'" />
The value returned per machine can then be saved to a customfield and your view can be based on the Customfield value
It obviously needs the agent procedure to be run on every machine, and you might need several procedures , or multiple lines in a procedure to get the value for each Policy by name, and of course it will not run until a machine is Online
An alternate to this is to use the same SQL but create a script (using e.g. VB / Powershell etc ) that actually runs on the VSA
So the script will populate the Database Customfield values directly and therefore no need for machines to be online