alerta_alerta-contrib/plugins/syslog
Nick Satterly 2a6632b78f Fix multiple linting errors 2023-03-21 00:15:34 +01:00
..
README.md Update READMEs 2020-11-20 22:39:32 +01:00
alerta_logger.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00
setup.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00

README.md

Syslog Plugin

Log alerts to syslog.

For help, join Slack chat

Installation

Clone the GitHub repo and run:

$ python setup.py install

Or, to install remotely from GitHub run:

$ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/syslog

Note: If Alerta is installed in a python virtual environment then plugins need to be installed into the same environment for Alerta to dynamically discover them.

Configuration

Add syslog to the list of enabled PLUGINS in alertad.conf server configuration file and set plugin-specific variables either in the server configuration file or as environment variables.

PLUGINS = ['syslog']

Default Configuration

SYSLOG_FORMAT = '%(name)s[%(process)d]: %(levelname)s - %(message)s'
SYSLOG_DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
SYSLOG_FACILITY = 'local7'

Example Configuration

The defaults are enough for most use-cases or override them in the alertad.conf configuration file:

PLUGINS = ['reject','syslog']
SYSLOG_FACILITY = 'local0'
Nov 21 20:42:37 c9b52479 root[17771]: WARNING - {"origin": "alerta/c9b52479.local", "text": "Instance was terminated unexpectedly", "lastReceiveTime": "2016-11-21T20:42:37.449Z", "receiveTime": "2016-11-21T20:42:37.449Z", "trendIndication": "lessSevere", "rawData": "", "previousSeverity": "major", "event": "InstanceTerminated", "group": "Misc", "severity": "warning", "service": ["AWS"], "id": "2359f60d-4e78-4dfa-b1d8-cb07853ca10a", "environment": "Production", "type": "exceptionAlert", "status": "open", "repeat": false, "tags": [], "createTime": "2016-11-21T20:42:37.383Z", "lastReceiveId": "5fd153a4-6d4c-4d18-9774-5414b8ebe96c", "customer": null, "resource": "i-0000101", "duplicateCount": 0, "correlate": [], "value": "n/a", "timeout": 86400, "attributes": {"ip": "127.0.0.1"}, "history": []}
Nov 21 20:42:42 --- last message repeated 1 time ---

References

License

Copyright (c) 2016 Nick Satterly. Available under the MIT License.