'Sending log message to the WhatsUp Event Viewer Context.LogMessage "Checking Address=" & Context.GetProperty("Address") objConnection = "Provider=SQLOLEDB; Data Source=.\whatsup;Initial Catalog=whatsup;Integrated Security=SSPI" Set conn = CreateObject("ADODB.Connection") conn.CursorLocation = 3 conn.open objConnection 'find records in the db for this device, change the -5 for however many minutes you want to check for sSql = "Select * from PassiveMonitorActivityLog where sSource='" & Context.GetProperty("Address") &"' and dEventTime between cast('" & DateAdd("n",-5,now) &"' as datetime) and cast('" & Now &"' as datetime)" Set rs = conn.Execute(sSql) if rs.recordcount>5 then 'this is set to 5 so 6 events in 5 minutes(set above) will trigger an alert Context.SetResult 1, "Error: " & rs.recordcount Context.LogMessage "records:" & rs.recordcount else Context.SetResult 0, "No error: " & rs.recordcount Context.LogMessage "records:" & rs.recordcount end if rs.Close if isobject(rs) then set rs=nothing if isobject(conn) then set conn=nothing if isobject(objConnection) then set objConnection=nothing