Hi, Was given the task of writing the tsql statements to trigger an alert for the Voip piece of the Solarwinds suite that we use. I manage the SQL server where the SolarWinds database resides, and have no problem writing code there versus the database and returning the desired result set. I use the 'Custom SQL Alert (advanced)' method of pasting in my tsql code to create the alert, and configure all the way through to Submit. At that point I see that the code I have entered will trigger 4000+ alerts if I were to enable it and let it run.
When I run the code versus the Solarwinds database on the SQL server it returns 5 or less rows, which would be 5 alerts fired, I think. Why when creating the alert in the application am I notified that 4000+ alerts will be fired and emails sent accordingly? That would rattle the voice guys a bit, and probably lead to a conversation with them.
And probably the Exchange guys too.
Here's what I wrote in TSQL below, with description of what I'm trying to alert on. I'm thinking something tsql doesn't convert to swql the right way.
Any thoughts or guidance would be greatly appreciated. Thanks, Dobbs
-- Query 1 -- The FinalCalledPartyNumber(voicemail 3699) is called more than 5 times in a 5 minutes.
Select VoipCallDetails.[FinalCalledPartyNumber], count(*) as FCPN_count
FROM VoipCallDetails
WHERE (( VoipCallDetails.[FinalCalledPartyNumber] = '3699')
AND VoipCallDetails.[Datetime] > DATEADD(ss, -300, GetDate()))
Group By VoipCallDetails.[FinalCalledPartyNumber]
Having count(*) > 5
--Query 2 -- The FinalCalledPartyNumber(voicemail 3699) is called by the same CallingPartyNumber more than 20 times within 5 minutes.
Select CallingPartyNumber, count(*) as CPN_count
FROM VoipCallDetails
WHERE (( VoipCallDetails.[FinalCalledPartyNumber] = '3699')
AND VoipCallDetails.[Datetime] > DATEADD(ss, -300, GetDate()))
Group By [CallingPartyNumber]
Having count(*) > 20