Clarification for how event-notification_rule matching works

45 views
Skip to first unread message

George Necula

unread,
Apr 18, 2015, 12:36:04 AM4/18/15
to flapjack...@googlegroups.com
Hello, 

   I am trying to setup flapjack with complete auto-discovery of entities and checks. The only thing I want to have to pre-configure are the contacts, media and notification_rules. I am using the ALL-entity hack. I am now trying to figure out how to do filtering based on notification_rules, and I cannot find any documentation. (The Notification Routing animation is cute, and I can appreciate the effort it took to build, but a pseudo-code description of the routing would be much much more helpful.) I have done some experiments and I have looked at the code also, but I do not quite feel that I fully understand this.  

  (I am experimenting with flapjack 1.5.0. I see that the code has changed quite a bit in 2.0, and I would be happy with documentation for either)

Thanks,
George.
  

Jesse Reynolds

unread,
Apr 30, 2015, 12:53:15 AM4/30/15
to flapjack...@googlegroups.com
Hi George, 

Thanks for the feedback. Yes, we need better documentation on how notification rules work. There is an open issue to describe how it’s architected in version 2, which is in our 2.0 milestone. If you want to help with user documentation, that’d be fantastic! Eg submit a PR to the flapjack.io repo. 

Are there some particular questions you’d like answered now to help your understanding? 

Cheers
Jesse

--

---
You received this message because you are subscribed to the Google Groups "flapjack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flapjack-proje...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Necula

unread,
May 5, 2015, 10:26:52 PM5/5/15
to flapjack...@googlegroups.com
Hi,

    I have tried to decode the logic for processing events and generating notifications (for 1.5.0). Can somebody confirm that this is correct ? I think that there may be a few minor details that I am missing.

   1. The entity name and check name are added as two additional tags to the incoming event tags

   2. Apply filtering to events. The event is discarded if ANY of the following are true:
       2.1 state is Ok
       2.2 entity/check is in scheduled or unscheduled maintenance
       2.3 current state duration for entity/check < initial_failure_delay (default 30 sec, can be specified in the incoming event)
       2.4. time since last notification < repeat_failure_delay (default 60 sec, can be specified in the incoming event)

   3. If the event was not discarded at step 2, generate a notification. 
   4. For each contact (Note: are these really all the contacts?)
         4.1. KEEP the notification rules for which ALL of the following are true:
             4.1.1 each rule tag is included in the event tags
             4.1.2 each rule regex_tags matches at least one of the event tags (Note: the implementation for this is buggy)
             4.1.3 rule has no entities or its entities include the event entity
             4.1.4 each rule regex_entities matches the event entity  (Note: this is strange)
             4.1.5 the time restrictions of the rule match the event time

        4.2 If there are no remaining notification rules, continue to the next contact
        4.3 If one of the remaining notification rules has <event_state>_blackhole == true, then continue to the next contact
        4.4 collect the set of media from the remaining notification rules, and send the notification to that media

 

 are extended with a tag 
Reply all
Reply to author
Forward
0 new messages