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

Proper method to get step ID for alerts

Jump to solution

What is the proper method to get a step ID for setting up alerts?  I am getting mixed results between the displayed TS# and what I find in the DB.

What should I be using?

 

For example I want to setup an alert so that if only step 1 for a transaction fails from all agents it will fire an alert.

0 Kudos
1 Solution

Problem here is that "recording" is kind of virtual item in SEUM. Specific instance is "transaction". That is why there are no alerts for recordings.

Would it be sufficient to have following alert:

Trigger alert for first transaction (ordered for example by ID) if all transactions for this recording (ie. recordings on all agents) are failing on specific (StepID = X or step position = X) step?

If yes, here is custom SQL:

WHERE 
(
	SELECT COUNT(DISTINCT tad.TransactionId) AS FailingTransactionsOnFirstStep
	FROM SEUM_TransactionsAlertsData tad JOIN SEUM_TransactionStepsAlertsData tsad
	  ON tad.TransactionId = tsad.TransactionId
	JOIN SEUM_RecordingSteps rs
	  ON rs.StepId = tsad.StepId
	WHERE tsad.Status = 2 
	AND tad.RecordingId = SEUM_TransactionsAlertsData.RecordingId
	AND rs.StepOrder = 1
) 
= 
( 
	SELECT COUNT(DISTINCT tad2.TransactionId) AS AllTransactions
	FROM SEUM_TransactionsAlertsData tad2 
	WHERE tad2.RecordingId = SEUM_TransactionsAlertsData.RecordingId
)
AND SEUM_TransactionsAlertsData.TransactionId = (
	SELECT MIN(tad3.TransactionId) AS FirstTransaction
	FROM SEUM_TransactionsAlertsData tad3
	WHERE tad3.RecordingId = SEUM_TransactionsAlertsData.RecordingId
)

Red line means that alert triggers if all first steps in transaction/recording meet the constraint. Constraint in this case is Status=2 which is "Down". If you want to alert based on step ID instead of step order, just replace re.StepOrder with rs.StepID.

Basic logic behind this is:
- Select all transactions
- where count of transactions for recording X that are failing on first step is equal to count of all transactions for that recording (recording is failing on all agents)
- but from these transaction select only first one (based on ID) so that alert is triggered only once per recording.

If you use some other comparison than "equals" for two counts, you can have alert like "alert me when more than 90% are failing" etc.

View solution in original post

0 Kudos
10 Replies
Level 17

You can go into the Alert Manager > Manage Alerts - and edit the existing Transaction Step alert.

 

You can then edit or add variables as needed.

0 Kudos

Mark thanks for the reply but what I was asking, perhaps incoherently , was how or where can I find the step IDs so I can alert only on say 1 step of 7?

I am trying to create a separate alert to take a different action if step 1 from all my playback locations fails.

0 Kudos

Hello Andrew,
if you need to alert on specific step "place" in transaction, let's say first step, you can try Custom SQL alert. Each step has order defined in database and this can be used in SQL query.

Try to create Custom SQL alert on SEUM: Step and into SQL condition enter:

JOIN SEUM_RecordingSteps rs ON SEUM_TransactionStepsAlertsData.StepId = rs.StepId
WHERE rs.StepOrder = 1

This selects all steps that are first (StepOrder = 1) in their transactions. You will need to add also other conditions to query to limit alert to steps that are down/critical/... but this part allows you your "first step in each transaction" logic.

0 Kudos

Jiri,

 

Is there anyway to modify the precanned select statements in the SQL alerts?

0 Kudos

Hello Andrew,
do you mean that part of SQL that is "read only" in advanced SQL alert? I'm afrait that it's not possible, this is generated from alerting structure.

Why do you need it? This "read only" part selects data required for specific object alert. Even if you change it, alert engine can use just those predefined values.

0 Kudos

My DBA was asking as we are trying to build a custom SQL alert that does the following.

 

For each RecordingID, check that StepID 1 is down from all agents.

 

I think we can do it with an alert per Recording ID but we were looking for a more efficient way

0 Kudos

Problem here is that "recording" is kind of virtual item in SEUM. Specific instance is "transaction". That is why there are no alerts for recordings.

Would it be sufficient to have following alert:

Trigger alert for first transaction (ordered for example by ID) if all transactions for this recording (ie. recordings on all agents) are failing on specific (StepID = X or step position = X) step?

If yes, here is custom SQL:

WHERE 
(
	SELECT COUNT(DISTINCT tad.TransactionId) AS FailingTransactionsOnFirstStep
	FROM SEUM_TransactionsAlertsData tad JOIN SEUM_TransactionStepsAlertsData tsad
	  ON tad.TransactionId = tsad.TransactionId
	JOIN SEUM_RecordingSteps rs
	  ON rs.StepId = tsad.StepId
	WHERE tsad.Status = 2 
	AND tad.RecordingId = SEUM_TransactionsAlertsData.RecordingId
	AND rs.StepOrder = 1
) 
= 
( 
	SELECT COUNT(DISTINCT tad2.TransactionId) AS AllTransactions
	FROM SEUM_TransactionsAlertsData tad2 
	WHERE tad2.RecordingId = SEUM_TransactionsAlertsData.RecordingId
)
AND SEUM_TransactionsAlertsData.TransactionId = (
	SELECT MIN(tad3.TransactionId) AS FirstTransaction
	FROM SEUM_TransactionsAlertsData tad3
	WHERE tad3.RecordingId = SEUM_TransactionsAlertsData.RecordingId
)

Red line means that alert triggers if all first steps in transaction/recording meet the constraint. Constraint in this case is Status=2 which is "Down". If you want to alert based on step ID instead of step order, just replace re.StepOrder with rs.StepID.

Basic logic behind this is:
- Select all transactions
- where count of transactions for recording X that are failing on first step is equal to count of all transactions for that recording (recording is failing on all agents)
- but from these transaction select only first one (based on ID) so that alert is triggered only once per recording.

If you use some other comparison than "equals" for two counts, you can have alert like "alert me when more than 90% are failing" etc.

View solution in original post

0 Kudos

Thanks Jiri 

Big help as always.

0 Kudos

It is the TS number you may see in URL when you display the Step details. Then check the condition of the alert on "TransactionStepId".

Thanks Michal. I was hoping there would be an easy way to tag just the inital step in each transaction but I can just piece them together in SQL.

0 Kudos