Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Conditional Alerting on Multiple WPM Transactions (Dependencies)

$
0
0

Hello,

this kind of alert can't work for one reason - alert conditions are always evaluated against single object (transaction) at a time. If you have "Name = A and Name = B", condition can never be true because transaction is either A or B but not both.

 

As you have transactions in a group, you could in theory alert on whole group's status if your conditions would be simpler, such as  "if any transaction is down, alert" or "if all transactions are down, alert". You don't have such simple requirement so probably the only way is to use custom SQL alert.

 

1) In Advanced Alert Manager select "Custom SQL Alert" in "Type of Property to Monitor".

2) In field "Set up your Trigger Query" that appears select "Group"

3) Into editable query field enter following SQL statement:

WHERE   
(  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'A' AND x.GroupMemberStatusName IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'B' AND x.GroupMemberStatusName IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'C' AND x.GroupMemberStatusName IN ('Down'))
)
OR
(  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'A' AND x.GroupMemberStatusName IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'B' AND x.GroupMemberStatusName NOT IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'C' AND x.GroupMemberStatusName IN ('Down'))
)
OR
(  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'A' AND x.GroupMemberStatusName NOT IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'B' AND x.GroupMemberStatusName IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'C' AND x.GroupMemberStatusName IN ('Down'))
)
OR
(  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'A' AND x.GroupMemberStatusName IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'B' AND x.GroupMemberStatusName NOT IN ('Down'))  AND  EXISTS (SELECT x.GroupMemberName FROM (SELECT a.GroupMemberName, a.GroupMemberStatusName FROM [Containers_AlertsAndReportsData] a WHERE a.GroupID = [Containers_AlertsAndReportsData].GroupID) x  WHERE x.GroupMemberName = 'C' AND x.GroupMemberStatusName NOT IN ('Down'))
)
GROUP BY Containers_AlertsAndReportsData.GroupID, Containers_AlertsAndReportsData.GroupName

 

Alert definition window will look like this:

group_alert.png

 

This definition should alert on condition that you specified in your original post. Each section in outer-most (...) is one of lines "A,B and C are Down" etc. Each section starting with "EXISTS" is "A is Down" or "C is Up" etc. For "is Up" I used "x.GroupMemberStatusName NOT IN ('Down')" because I assume that by "Up" you mean "Not Down" so also warning and critical statuses are considered "Up". If you want any other status to be considered as "Down", such as "Unknown", you can just extend all "NOT IN ('Down')" and "IN ('Down')" to "NOT IN ('Down','Unknown')" and "IN ('Down', 'Unknown')".

 

If you need to add another transaction in to condition or another combination of statuses into condition, you can just add another sections to SQL query.

 

This alert will alert on the whole group so it works only for transactions that are in a group.

 

Let us know if you have any issues with setting this up.


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>