Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Conditions based on previous alert contents?

Paul Lopez September 3, 2021

I am not sure if this is possible, but am trying to figure out if it is - appreciate any insight. 

We have a system that delivers 'up' and 'down' alerts for BGP link status. This is a libreNMS delivering to Opsgenie from incoming SNMP traps.  We want opsgenie to alert us when a 'Down' alert is recieved, and an 'Up' alert so we know when peers recover on their own. 

However, sometimes our routers issue fake 'up' alerts. We want to ignore these. 

The logic I am trying to recreate goes something like this: 

"If alert contains text 'BGP Up', then only notify if 'AS#####' (The AS number contained in the body of the alert) matches an AS##### in a previous alert recieved within the last, say 24 hours". 

I've been reading through policies section, action filters and 'services' which still confuse me to see if anything like this is possible, and I'm starting to think it's not. 

Looking for the communities opinion - is there any way to corellate an alert to the textual content of a previous alert and make that a condition of the alert triggering in this way?

Our option B is to just 'ignore' 'Up' alerts from the two older routers that seem to be issuing the fake up alerts. 

1 answer

1 vote
Connor Eyles
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2021

Hey Paul!

I'm Connor from the Opsgenie support team here at Atlassian 😊

If I understand this correctly and please correct me if I am wrong here, The logic you are wanting to do here is "If alert contains text 'BGP Up', then only notify if 'AS#####' (The AS number contained in the body of the alert) matches an AS##### in a previous alert received within the last, say 24 hours".

  • Now is the timeframe important here for your logic?
  • A real UP message will contain a matching AS##### and an existing alert is open with the same AS##### correct? 
  • A fake UP message will send a UP message containing AS##### with no existing open down alert? 

So if this is the case what you can do is configure your integration so that the create action ignores UP messages and the UP messages can match the close action here. The logic here is when your system sends a UP message and there is an existing open alert that matches the AS##### it will automatically close the alert but if there is no existing open alert it will ignore that alert. You can set notifications when an alert is automatically closed, if you don't want the alert to close to set the UP messages to match the add note action instead. 

To achieve this you can do the following:

  • Edit the integration so that the create action ignores UP messages, configure the filter with your desired conditions.
  • Ensure that the alias is configured so that the UP messages and down messages match with each other. The Alias field is a user-defined unique identifier for "open" alerts so for example if an open alert is AS##### and a UP alert comes in with the same alias the close action will match against this.
  • Have the conditions set on the close action so that the UP messages match this action.

Now if you wanted to pull out AS##### from your payload you can use our string processing methods or regex to do this:

For option 2 if you wanted to simply ignore the UP messages then all you need to do is configure the filters on the create action like this - 
Image 2021-09-06 at 9.31.05 am

 

Thanks,
Connor

Paul Lopez September 7, 2021

Hi Conner -- you have interpreted my request correctly, and this sounds like it will probably work. I will give it a try and report back in a few days.

Thankyou!

Connor Eyles
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 7, 2021

Glad to hear it Paul 😊

Let me know how you go!

Thanks,

Connor

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events