I want to return the results of a t-sql query or at least send an alert based on the presence of a substring in the query. I have my data options set to process sting data and Repsonse must not contain 'job'. I know the query returns data that should satisfy this condition but no alert is generated. Are there wildcards or additional formatting that is required?

thanks Brian


Article Comments

Hello,

can you please upload a screenshot showing the "Settings" of this SQL-Sensor? Alternatively, please send it to support@paessler.com via email.

best regards.


Jan, 2013 - Permalink

Hi,

Below is the configuration using the 'dump to clipboard' function within PRTG. The t-sql code is deleted but I know this returns a value after testing in SSMS. The query returns 3 fields and the 3rd field should always have the word 'job' as a substring. I want to raise an alert and ideally include the query output if any rows are returned.

I have a dumbed-down version of the monitor that just counts the rows in the query and raises an alert if the count is greater than 0. However, it's the actual query results that are needed.

Thanks Brian

'name_':'JobQueue+Stuck+Jobs',
'tags_':'sqlsensor',
'priority_':'3',
'timeout_':'60',
'instance_':'',
'useport_':'0',
'port_':'1433',
'database_':'JobQueue',
'authentication_':'1',
'user_':'',
'password_':'',
'sql_':<T-SQL code snipped>',
'hasresultset_':'2',
'getrecordcount_':'0',
'datawarningmode_':'0',
'datalimitwarning_':'0',
'datadownmode_':'0',
'datalimitdown_':'0',
'includemust_':'',
'includemustnot_':'job',
'primarychannel_':'2%7CValue%7C',
'stack_':'0',
'stackunit_':'%3Fraw-s5%7C%23',
'intervalgroup':'0',
'intervalgroup':'1',
'interval_':'60%7C60+seconds',
'inherittriggers':'1',
'scheduledependency':'0',
'scheduledependency':'1',
'schedule_':'-1%7CNone%7C',
'dependencytype_':'0',
'dependency_':'',
'depdelay_':'0',
'id':'21011'

Jan, 2013 - Permalink

Can you please try changing the SQL-Query so that it does only return one field, the one you are looking to check? Does it work then?


Feb, 2013 - Permalink