I want to use this query
IF EXISTS(SELECT 1 FROM sys.dm_exec_sessions WHERE program_name = 'SQLAgent - Generic Refresher') SELECT 'TRUE'ELSE SELECT 'FALSE'
Within which product? More than likely you'll need to convert the output to a number. In Server & Application Monitor (SAM) , there's a SQL Server User Experience Monitor that can run queries and return results. The results need to be numerical though. Easy fix for your query is that 1 = True and 0 = False.