Trying to make a backups alert

Alojz Cuk September 27, 2021

Hello,

 

What I am trying to do is create an opsgenie alert for backups.

 

The workflow I have in mind is if a success email comes in, opsgenie ignores.

If a failed job email comes in, open a ticket. This will have the backup job name on it.

When the job succeeds, the success email will come in and close the alert in opsgenie.

 

The issue im having is how do I make the success email job work with the failed job?

The success email needs to match the job name of the failed job. How would I go about matching the two in order for OpsGenie to know to close the alert?

 

I have set up the ignore for [Success] as jobs will run and complete successfully. I need the success emails to come in to let OpsGenie know to close the alert once the failed job with the same job name comes in.

opsgenie ignore.png

 

I have the create alert here. The alert subject will be [failed] %BackupJob% has x failed items. Thats no problem. Might show up as [failed] Infrastructure has 3 failed itemsopsgennie create.png

 

Now wondering how would I make the close ticket recognise the backup job name with [success] in the subject to know that the job has completed successfully and close the ticket.

opsgenie close.png

1 answer

1 accepted

1 vote
Answer accepted
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 28, 2021

Hi @Alojz Cuk ,

You're somewhat on the right track here, but missing a few parts.

It's important to note that all of the integration's actions are evaluated from top >> bottom; so the Ignore action(s) are evaluated first, then the Create Alert action(s), etc.

If you have an Ignore action configured to ignore creating alerts for [Success] requests, Opsgenie will always ignore these and the request will never have a chance to close the alert through the integration.

So I think you actually want to remove the Ignore action entirely. You'd also want to change the Create Alert action's filter from Match All Alerts >> something similar to the Close Alert action - but one that only creates alerts for when [Failed] is in the subject or something.

And finally, edit the Close Alert action to close alerts when [Success] is in the subject or being parsed in the payload. That entire configuration might look something like this:

emailcomm1.jpgemailcomm2.jpg

 

Note as well in both my screenshots the alias field highlighted. The alias is the unique identifier of an alert, and what the integration uses to close an alert if there is already an open existing alert in Opsgenie. You would need to configure this in all your actions, and it should be consistent with both the create and close request. Otherwise Opsgenie won't know which alert to close. 

Hope this helps! Let us know if you have any other questions, concerns, etc.

Alojz Cuk September 28, 2021

That worked! thanks SOOOO MUCH!

Like Nick H likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events