cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

SQL query to Alert

I have been working for a week on this and have not figured it out. What I want is to have an alert fire from a SQL query.

It is for my CallManager. I have found everything that shows me the number of calls. I am wanting to have SolarWinds send an alert when the number of calls reaches a certain number or higher.

What I have is a Custom SQL Alert. Here is what I have typed in the box:

where custompollerassignmentid = 'e9XXXX2f-0XX8-4XX4-9e07-cXXXXebb32bb' and rowid = '20'

It returns one value in SQL, and I want to find out how to make the Alert system fire when the number returned is 50 or higher.

0 Kudos
15 Replies
Level 15

would it not be easier to use the GUI for this?

2015-03-17_10-41-36.jpg

0 Kudos

I have tried for many days to use the GUI, but to no avail....... it looks like custom SQL queries are the way to go.

0 Kudos

Can you show us a screenshot of the results of this query?

SELECT * FROM CustomPollerStatusTable WHERE CustomPollerAssignmentID = 'e9XXXX2f-0488-4XX4-9XX7-ca3eXXXXX2bb' AND RowID = '20'

0 Kudos

2015_03_17_11_09_47_10.10.111.20_Remote_Desktop_Connection.jpg

0 Kudos

The Rate is what I need to Alert on

0 Kudos

OK, so you have 2 options:

1) as njoylif‌ mentioned, you can just add your rate limitation to your current Custom SQL:

SELECT CustomPollerStatusTable.CustomPollerAssignmentID, CustomPollerStatusTable.CompressedRowID, CustomPollerStatusTable.FullLabel

FROM CustomPollerStatusTable

WHERE CustomPollerAssignmentID = 'e9XXXX2f-0488-4XX4-9XX7-ca3eXXXXX2bb'

AND RowID = '20'

AND Rate >= '50'

2) You can use the GUI, following the screenshot I posted earlier, and get the same end result. (The GUI does nothing more than build the SQL query for you)

Either way you choose should result in the same alert conditions.

0 Kudos

I like the one where we build the query.

But how do we make SolarWinds Alert from that?

0 Kudos

2015_03_17_12_37_32_Edit_Alert_Number_of_Calls_.jpg

This is what happens when I add the rate => '50'. I did it both with the tick marks and not.

0 Kudos

How do you enable advanced alerts? I don't have Custom SQL Query listed.

hebron1212_0-1602508199205.png

 

0 Kudos

Try this:

WHERE CustomPollerStatusTable.CustomPollerAssignmentID = 'e9XXXX2f-0488-4XX4-9XX7-ca3eXXXXX2bb' 

AND CustomPollerStatusTable.RowID = '20' 

AND CustomPollerStatusTable.Rate >= '50'

It worked.

0 Kudos
Level 18

Can you past the full query which works in SQL Management studio? and then some sample rows for what you get as a result?

That would help.

Leon Adato | Head Geek
------
"Measure what is measurable,
and make measurable what is not so." - Gallileo

0 Kudos

SELECT CustomPollerStatusTable.CustomPollerAssignmentID, CustomPollerStatusTable.CompressedRowID, CustomPollerStatusTable.FullLabel FROM CustomPollerStatusTable

where custompollerassignmentid = 'e9XXXX2f-0488-4XX4-9XX7-ca3eXXXXX2bb' and rowid = '20'

But I just found out that it does not return what I thought. If I change the query to:

SELECT * FROM CustomPollerStatusTable

It returns the Rate field. But I cannot get the Rate field from the alert thingy because it defines the top portion of this email.

0 Kudos

you can include that in your WHERE clause even if not returned.

should be able to just add:

AND Rate >=50

0 Kudos

How do I add it in the where clause? How do I make an Alert out of it?

0 Kudos