diff --git a/docker-compose/alerta-web/alertad.conf b/docker-compose/alerta-web/alertad.conf index 2e95d14289d00bb341b393f95f04a62614378767..735a84fc21ccb3cdd34854a7daefaf4e8b886bd2 100644 --- a/docker-compose/alerta-web/alertad.conf +++ b/docker-compose/alerta-web/alertad.conf @@ -16,7 +16,7 @@ DATE_FORMAT_MEDIUM_DATE = "dd DD/MM HH:mm" DATE_FORMAT_LONG_DATE = "yyyy-MM-DD HH:mm:ss.sss" # Default overview settings -COLUMNS = ['severity', 'status', 'lastReceiveTime', 'environment', 'resource', 'lofarDevice', 'lofarAttribute', 'event', 'text'] +COLUMNS = ['severity', 'status', 'lastReceiveTime', 'resource', 'lofarDevice', 'lofarAttribute', 'event', 'text'] DEFAULT_FILTER = {'status': ['open']} SORT_LIST_BY = "createTime" AUTO_REFRESH_INTERVAL = 5000 # ms @@ -44,13 +44,13 @@ BASE_URL = os.environ.get("BASE_URL", "") SLACK_PAYLOAD = { "channel": "{{ channel }}", "emoji": ":fire:", - "text": "*{{ alert.severity|capitalize }}* :: _{{ alert.event }}_\n\n```{{ alert.text }}```", + "text": "*{{ alert.severity|capitalize }}* :: *{{ alert.resource }}* :: _{{ alert.event }}_\n\n```{{ alert.text }}```", "attachments": [{ "color": "{{ color }}", "fields": [ {"title": "Device", "value": "{{ alert.attributes.lofarDevice }}", "short": True }, {"title": "Attribute", "value": "{{ alert.attributes.lofarAttribute }}", "short": True }, - {"title": "Environment", "value": "{{ alert.environment }}", "short": True }, + {"title": "Resource", "value": "{{ alert.resource }}", "short": True }, {"title": "Status", "value": "{{ status|capitalize }}", "short": True }, {"title": "Dashboards", "value": "<{{ config.BASE_URL }}/#/alert/{{ alert.id }}|Alerta>\nGrafana <{{ alert.attributes.grafanaDashboardUrl }}|Dashboard> <{{ alert.attributes.grafanaPanelUrl }}|Panel>", "short": True }, {"title": "Configure", "value": "Grafana <{{ alert.attributes.grafanaAlertUrl }}|View> <{{ alert.attributes.grafanaSilenceUrl }}|Silence>", "short": True }, diff --git a/docker-compose/alerta-web/lofar-plugin/alerta_lofar.py b/docker-compose/alerta-web/lofar-plugin/alerta_lofar.py index eaaed8614d34be68c7fa217e813760b75fe9161b..c4f618d2d6675feab78fce49cedc9f8030766c97 100644 --- a/docker-compose/alerta-web/lofar-plugin/alerta_lofar.py +++ b/docker-compose/alerta-web/lofar-plugin/alerta_lofar.py @@ -26,6 +26,9 @@ class EnhanceLOFAR(PluginBase): if key == "name": alert.attributes['lofarAttribute'] = value + if key == "station": + alert.resource = value + return alert def post_receive(self, alert, **kwargs):