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.
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.
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'
To Reproduce Steps to reproduce the behavior:
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.