Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blackout never end if alert is not updated #577

Open
danielelopez1 opened this issue Mar 28, 2024 · 0 comments
Open

Blackout never end if alert is not updated #577

danielelopez1 opened this issue Mar 28, 2024 · 0 comments

Comments

@danielelopez1
Copy link

Issue Summary
when you set a blackout, the alert status don't change when the blackout expire. It change when a new alert arrive, but if not, it always shows as blackout.

Environment

  • OS: Centos7

  • API version: 8.7.0

  • Deployment: Docker

  • Database: Postgres

  • Server config:
    DATABASE_URL = 'postgresql://user:pass@myhost/alerta'
    DATABASE_NAME = 'alerta'
    BASE_URL='/api'
    ALERT_TIMEOUT= 0
    DEFAULT_EXPIRED_DELETE_HRS = 0
    DEFAULT_INFO_DELETE_HRS = 0
    SHELVE_TIMEOUT=1
    HISTORY_LIMIT = 1000
    HISTORY_ON_VALUE_CHANGE = False
    DEFAULT_PAGE_SIZE = 1500

PLUGINS = [
"blackout",
"reject"
]

DELETE_SCOPES = ["delete:alerts"]

NOTIFICATION_BLACKOUT = True
BLACKOUT_ACCEPT = ['normal', 'ok', 'cleared']

CUSTOMER_VIEWS = True
DEFAULT_FIELD = 'resource'

AUTH_REQUIRED = True
ADMIN_USERS = ['admin']
ADMIN_ROLES = ['admin']
USER_DEFAULT_SCOPES = ['read:alerts','read:customers']
AUTH_PROVIDER = 'basic'
SIGNUP_ENABLED = False
GUEST_DEFAULT_SCOPES = ['read:alerts']

AUTO_REFRESH_INTERVAL=60000
ALLOWED_ENVIRONMENTS = ['Production', 'Pre-Production', 'Disaster Recovery', 'Development', 'Test', 'UNKNOWN']
COLUMNS = ['severity', 'status', 'createTime', "customer", 'origin', 'environment', 'service', 'resource', 'event', 'text', 'owner','ip']

DEBUG = False

AUDIT_TRAIL = ['admin', 'write', 'auth']
AUDIT_LOG = True
AUDIT_LOG_JSON = True

LOG_HANDLERS = ['file']
LOG_FILE = '/var/log/alerta/alertad.log'
LOG_BACKUP_COUNT = 1
LOG_FORMAT = 'json'
LOG_LEVEL = 'WARNING'

  • web UI version: 8.7.0
  • alerta 8.7.0
  • alerta client 8.5.1
  • requests 2.26.0
  • click 8.0.3

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'blackout'
  2. Set blackout
  3. receive an alert that match blackout
  4. wait for blackout to expire

For web app issues, include any web browser JavaScript console errors.

Expected behavior
when blackout end, the blackout status on the alert had to expire as well, and return the previous status.

Additional context
I know alerta donesn't work retroactively on alerts, but some things need to be done retroactively, like blackouts. if you can please tell me where to find the code that match the alerts with the blackout, I can try to implement a plugin or modify the code itself, to achive this. The idea is: when I set a blackout, I run the blackout against all alerts that match, and set them in the blackout status. (not the closed ones). when an alert match the blackout, I can assign the blackout id to that alert (more then one if it matchs more blackouts). when the blackout expire, I make a select to match all the alerts that match that blackout (by blackoutid) and remove it. if there are no more blackouts id on that alert, I'll restore the previous alert's status.
maybe there is a better way to do it, but I have no idea how it works now. If you can please tell me the best way to achive this, I can try to work on it and then I'll give you the code for future implementations.

@danielelopez1 danielelopez1 changed the title Blackout never end if alert is not upfated Blackout never end if alert is not updated Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant