Exemple #1
0
 def pre_receive(self, alert):
     if alert.is_blackout():
         if app.config.get('NOTIFICATION_BLACKOUT', False):
             alert.attributes['notify'] = False
         else:
             raise BlackoutPeriod("Suppressed alert during blackout period")
     return alert
Exemple #2
0
    def pre_receive(self, alert, **kwargs):
        NOTIFICATION_BLACKOUT = self.get_config('NOTIFICATION_BLACKOUT', default=True, type=bool, **kwargs)

        if alert.is_blackout():
            if NOTIFICATION_BLACKOUT:
                alert.status = 'blackout'
            else:
                raise BlackoutPeriod('Suppressed alert during blackout period')
        return alert
Exemple #3
0
    def pre_receive(self, alert):

        if alert.is_blackout():
            if NOTIFICATION_BLACKOUT:
                LOG.debug('Set status to "blackout" during blackout period (id=%s)' % alert.id)
                alert.status = 'blackout'
            else:
                LOG.debug('Suppressed alert during blackout period (id=%s)' % alert.id)
                raise BlackoutPeriod('Suppressed alert during blackout period')
        return alert
Exemple #4
0
    def pre_receive(self, alert):

        is_blackout = alert.is_blackout()
        do_not_notify = app.config.get('NOTIFICATION_BLACKOUT', False)

        if do_not_notify and is_blackout:
            alert.attributes['notify'] = False
        elif do_not_notify and not is_blackout:
            alert.attributes['notify'] = True
        elif not do_not_notify and is_blackout:
            raise BlackoutPeriod("Suppressed alert during blackout period")
        return alert
Exemple #5
0
    def pre_receive(self, alert):

        if app.config['ALARM_MODEL'] == 'ALERTA':
            status = 'blackout'
        else:
            status = 'OOSRV'  # ISA_18_2

        if alert.is_blackout():
            if NOTIFICATION_BLACKOUT:
                LOG.debug('Set status to "{}" during blackout period (id={})'.format(status, alert.id))
                alert.status = status
            else:
                LOG.debug('Suppressed alert during blackout period (id={})'.format(alert.id))
                raise BlackoutPeriod('Suppressed alert during blackout period')
        return alert
Exemple #6
0
    def pre_receive(self, alert, **kwargs):
        NOTIFICATION_BLACKOUT = self.get_config('NOTIFICATION_BLACKOUT', default=True, type=bool, **kwargs)

        if self.get_config('ALARM_MODEL', **kwargs) == 'ALERTA':
            status = 'blackout'
        else:
            status = 'OOSRV'  # ISA_18_2

        if alert.is_blackout():
            if NOTIFICATION_BLACKOUT:
                LOG.debug(f'Set status to "{status}" during blackout period (id={alert.id})')
                alert.status = status
            else:
                LOG.debug(f'Suppressed alert during blackout period (id={alert.id})')
                raise BlackoutPeriod('Suppressed alert during blackout period')
        return alert
Exemple #7
0
 def pre_receive(self, alert):
     if alert.is_blackout():
         raise BlackoutPeriod('Suppressed alert during blackout period')
     return alert