I have 18 days left of my trial. PRTG does everything i want it too to be able to finally allow me to move from using Nagios, but i need 1 more thing to be able to accomplish before my boss will part with the cash for a licence....
I need to be able to monitor databases for Blocking and be alerted when there is a query being blocked for longer than X minutes.
I am trying to use the MS Sql v2 Sensor to run a .sql query file which is thus:
DECLARE @WhoTable TABLE ( SPID INT, [Status] VARCHAR(MAX), [Login] VARCHAR(MAX), HostName VARCHAR(MAX), BlkBy VARCHAR(MAX), DBName VARCHAR(MAX), Command VARCHAR(MAX), CPUTime INT, DiskIO INT, LastBatch VARCHAR(MAX), ProgramName VARCHAR(MAX), SPID_1 INT, REQUESTID INT ) INSERT INTO @WhoTable EXEC sp_Who2 SELECT SPID, BlkBy FROM @WhoTable
This outputs a table:
Now id like to pass the SPID and BlkBy data into the sensor
Not sure how to go about this though as the BlkBy value is neither NULL or numeric if nothing is being blocked, just a -
In an ideal world id like the sensor to be OK when there is nothing being blocked, to report as down when blocking takes place and BlkBy will have the SPID of the user blocking it.
Is this possible please, if so could somebody help me out as all im getting when trying different combinations setting the sensor up is [System.String] value can not be parsed