├── plugins
├── README.md
├── dingtalk
│ ├── dingtalkchatbot
│ │ ├── __init__.py
│ │ └── __about__.py
│ ├── setup.py
│ ├── alerta_ding.py
│ └── README.md
├── slack
│ ├── images
│ │ └── alerta-slack-plugin.png
│ ├── setup.py
│ └── test_slack.py
├── telegram
│ ├── images
│ │ └── alerta-telegram-plugin.png
│ └── setup.py
├── rocketchat
│ ├── images
│ │ └── alerta-rocketchat-plugin.png
│ ├── setup.py
│ └── alerta_rocketchat.py
├── logstash
│ ├── logstash-simple.conf
│ ├── setup.py
│ ├── README.md
│ └── alerta_logstash.py
├── matrix
│ ├── setup.py
│ ├── README.md
│ └── alerta_matrix.py
├── jira
│ ├── setup.py
│ └── README.md
├── syslog
│ ├── setup.py
│ ├── alerta_logger.py
│ └── README.md
├── enhance
│ ├── setup.py
│ ├── alerta_enhance.py
│ └── README.md
├── debug
│ ├── setup.py
│ ├── README.md
│ └── alerta_debug.py
├── normalise
│ ├── setup.py
│ ├── alerta_normalise.py
│ └── README.md
├── goalert
│ ├── setup.py
│ └── README.md
├── op5
│ ├── setup.py
│ ├── README.md
│ └── alerta_op5.py
├── forward
│ ├── setup.py
│ ├── README.md
│ └── alerta_forward.py
├── sns
│ ├── setup.py
│ ├── README.md
│ └── alerta_sns.py
├── geoip
│ ├── setup.py
│ ├── alerta_geoip.py
│ └── README.md
├── zabbix
│ ├── setup.py
│ └── README.md
├── alertops
│ ├── setup.py
│ ├── README.md
│ └── alerta_alertops.py
├── opsgenie
│ ├── setup.py
│ └── README.md
├── pushover
│ ├── setup.py
│ ├── alerta_pushover.py
│ └── README.md
├── amqp
│ ├── setup.py
│ ├── listener.py
│ ├── alerta_amqp.py
│ └── README.md
├── influxdb
│ ├── setup.py
│ ├── README.md
│ └── alerta_influxdb.py
├── pagerduty
│ ├── setup.py
│ ├── README.md
│ └── alerta_pagerduty.py
├── timeout
│ ├── setup.py
│ ├── alerta_timeout.py
│ └── README.md
├── cachet
│ ├── setup.py
│ ├── README.md
│ └── alerta_cachet.py
├── mattermost
│ ├── setup.py
│ ├── alerta_mattermost.py
│ └── README.md
├── msteams
│ ├── setup.py
│ ├── example-payload.json.j2
│ └── README.md
├── pubsub
│ ├── setup.py
│ ├── README.md
│ └── alerta_pubsub.py
├── prometheus
│ └── setup.py
└── twilio
│ ├── setup.py
│ ├── README.md
│ └── alerta_twilio_sms.py
├── webhooks
├── README.md
├── mailgun
│ ├── images
│ │ └── mailgun-webhook.png
│ ├── setup.py
│ ├── README.md
│ └── alerta_mailgun.py
├── sentry
│ ├── images
│ │ └── sentry-webhook.png
│ ├── setup.py
│ └── alerta_sentry.py
├── statuscake
│ ├── images
│ │ └── statuscake-webhook.png
│ ├── setup.py
│ ├── README.md
│ └── alerta_statuscake.py
├── fail2ban
│ ├── setup.py
│ ├── alerta_fail2ban.py
│ └── README.md
├── query
│ ├── setup.py
│ ├── README.md
│ └── alerta_query.py
├── msteams
│ ├── setup.py
│ ├── README.md
│ └── alerta_msteamswebhook.py
└── azuremonitor
│ ├── setup.py
│ └── README.md
├── integrations
├── README.md
├── mailer
│ ├── setup.cfg
│ ├── requirements.txt
│ ├── setup.py
│ ├── email.tmpl
│ └── email.html.tmpl
├── opsgenie
│ └── images
│ │ ├── 2.png
│ │ ├── 3.png
│ │ └── alert-filter.png
├── syslog
│ ├── images
│ │ └── alerta-syslog.png
│ ├── setup.py
│ └── README.md
├── supervisor
│ ├── supervisord.conf.example
│ ├── README.md
│ └── evlistener.py
├── urlmon
│ ├── settings.py
│ ├── setup.py
│ └── README.md
├── snmptrap
│ └── setup.py
├── sqs
│ ├── setup.py
│ ├── README.md
│ └── alerta_sqs.py
├── consul
│ ├── setup.py
│ ├── consulheartbeat.py
│ ├── README.md
│ └── consulalerta.py
├── pinger
│ ├── setup.py
│ └── README.md
├── fail2ban
│ ├── fail2ban-alerta.sh
│ ├── README.md
│ └── alerta.conf
└── opsweekly
│ └── README.md
├── .pylintrc
├── requirements-dev.txt
├── .isort.cfg
├── .gitignore
├── LICENSE
├── .pre-commit-config.yaml
├── AUTHORS
└── README.md
/plugins/README.md:
--------------------------------------------------------------------------------
1 | # Alerta Contrib Plugins
2 |
--------------------------------------------------------------------------------
/plugins/dingtalk/dingtalkchatbot/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/webhooks/README.md:
--------------------------------------------------------------------------------
1 | # Alerta Contrib Webhooks
2 |
--------------------------------------------------------------------------------
/integrations/README.md:
--------------------------------------------------------------------------------
1 | # Alerta Contrib Integrations
2 |
--------------------------------------------------------------------------------
/integrations/mailer/setup.cfg:
--------------------------------------------------------------------------------
1 | [aliases]
2 | test=pytest
3 |
--------------------------------------------------------------------------------
/integrations/mailer/requirements.txt:
--------------------------------------------------------------------------------
1 | alerta>=5.0.2
2 | jinja2
3 | kombu
4 | redis
5 |
--------------------------------------------------------------------------------
/integrations/opsgenie/images/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/integrations/opsgenie/images/2.png
--------------------------------------------------------------------------------
/integrations/opsgenie/images/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/integrations/opsgenie/images/3.png
--------------------------------------------------------------------------------
/.pylintrc:
--------------------------------------------------------------------------------
1 | [MESSAGES CONTROL]
2 | disable=R,C,W,import-error,broad-except
3 |
4 | [TYPECHECK]
5 | ignored-classes=_socketobject
6 |
--------------------------------------------------------------------------------
/webhooks/mailgun/images/mailgun-webhook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/webhooks/mailgun/images/mailgun-webhook.png
--------------------------------------------------------------------------------
/webhooks/sentry/images/sentry-webhook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/webhooks/sentry/images/sentry-webhook.png
--------------------------------------------------------------------------------
/integrations/opsgenie/images/alert-filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/integrations/opsgenie/images/alert-filter.png
--------------------------------------------------------------------------------
/integrations/syslog/images/alerta-syslog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/integrations/syslog/images/alerta-syslog.png
--------------------------------------------------------------------------------
/plugins/slack/images/alerta-slack-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/plugins/slack/images/alerta-slack-plugin.png
--------------------------------------------------------------------------------
/plugins/telegram/images/alerta-telegram-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/plugins/telegram/images/alerta-telegram-plugin.png
--------------------------------------------------------------------------------
/webhooks/statuscake/images/statuscake-webhook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/webhooks/statuscake/images/statuscake-webhook.png
--------------------------------------------------------------------------------
/plugins/rocketchat/images/alerta-rocketchat-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alerta/alerta-contrib/HEAD/plugins/rocketchat/images/alerta-rocketchat-plugin.png
--------------------------------------------------------------------------------
/plugins/logstash/logstash-simple.conf:
--------------------------------------------------------------------------------
1 | input {
2 | tcp {
3 | port => 6379
4 | codec => json_lines
5 | }
6 | }
7 | output {
8 | elasticsearch { hosts => ["localhost:9200"] }
9 | stdout { codec => rubydebug }
10 | }
11 |
--------------------------------------------------------------------------------
/requirements-dev.txt:
--------------------------------------------------------------------------------
1 | alerta
2 | alerta-server[mongodb]
3 | alerta-server[postgres]
4 | kombu
5 | mock
6 | mypy==1.0.1
7 | pre-commit==2.20.0
8 | PyJWT>=2.0.0
9 | pylint==2.16.2
10 | pytest-cov
11 | pytest>=5.4.3
12 | python-dotenv
13 | requests_mock
14 | six
15 | StrEnum
16 |
--------------------------------------------------------------------------------
/.isort.cfg:
--------------------------------------------------------------------------------
1 | [settings]
2 | known_third_party = Queue,alerta,alerta_azuremonitor,alerta_msteamswebhook,alerta_sentry,alerta_slack,alertaclient,boto,cachetclient,consul,dateutil,dingtalkchatbot,flask,google,influxdb,jinja2,kombu,mailer,matterhook,mock,op5,pymsteams,pytest,pyzabbix,requests,settings,setuptools,telepot,twilio,yaml
3 |
--------------------------------------------------------------------------------
/plugins/dingtalk/dingtalkchatbot/__about__.py:
--------------------------------------------------------------------------------
1 | __title__ = 'DingtalkChatbot'
2 | __description__ = '一个钉钉自定义机器人消息的Python封装库'
3 | __url__ = 'https://github.com/zhuifengshen/DingtalkChatbot'
4 | __version__ = '1.3.0'
5 | __author__ = 'devin'
6 | __author_email__ = '1324556701@qq.com'
7 | __license__ = 'MIT'
8 | __cake__ = '\u2728 \U0001f370 \u2728'
9 |
--------------------------------------------------------------------------------
/integrations/supervisor/supervisord.conf.example:
--------------------------------------------------------------------------------
1 | [supervisord]
2 | logfile=/var/log/supervisord.log
3 | logfile_backups=2
4 | loglevel=debug
5 | pidfile=/var/run/supervisord.pid
6 | nocleanup=true
7 | childlogdir=/var/log
8 | environment=ALERTA_ENDPOINT="http://localhost:8080",ALERTA_API_KEY="demo-key"
9 |
10 | [program:foo]
11 | command=sleep 300
12 |
13 | [eventlistener:evlistener]
14 | command=%(here)s/evlistener.py
15 | events=PROCESS_STATE,TICK_60
16 | buffer_size=1024
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.py[cod]
2 |
3 | # C extensions
4 | *.so
5 |
6 | # Packages
7 | *.egg
8 | *.eggs
9 | *.egg-info
10 | dist
11 | build
12 | eggs
13 | parts
14 | var
15 | sdist
16 | develop-eggs
17 | .installed.cfg
18 | lib
19 | lib64
20 | __pycache__
21 |
22 | # Installer logs
23 | pip-log.txt
24 |
25 | # Unit test / coverage reports
26 | .coverage
27 | .tox
28 | nosetests.xml
29 |
30 | # Translations
31 | *.mo
32 |
33 | # Mr Developer
34 | .mr.developer.cfg
35 | .project
36 | .pydevproject
37 |
38 | .idea
39 | TODO
40 | *.log
41 |
42 | venv
43 |
--------------------------------------------------------------------------------
/plugins/matrix/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '0.1.0'
4 |
5 | setup(
6 | name='alerta-matrix',
7 | version=version,
8 | description='Alerta plugin for Matrix',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Magnus Walbeck',
12 | author_email='mw@mwalbeck.org',
13 | packages=find_packages(),
14 | py_modules=['alerta_matrix'],
15 | install_requires=['requests'],
16 | include_package_data=True,
17 | zip_safe=True,
18 | entry_points={'alerta.plugins': ['matrix = alerta_matrix:SendMessage']},
19 | )
20 |
--------------------------------------------------------------------------------
/plugins/jira/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '1.0.0'
4 |
5 | setup(
6 | name='alerta-jira',
7 | version=version,
8 | description='Alerta plugin for create tasks in jira',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Alexandre Azedo',
12 | author_email='aazedo@gocontact.pt',
13 | packages=find_packages(),
14 | py_modules=['alerta_jira'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | entry_points={
18 | 'alerta.plugins': [
19 | 'jira = alerta_jira:JiraCreate'
20 | ]
21 | }
22 | )
23 |
--------------------------------------------------------------------------------
/plugins/syslog/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.2'
4 |
5 | setup(
6 | name='alerta-logger',
7 | version=version,
8 | description='Alerta plugin for syslog logging',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_logger'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | entry_points={
18 | 'alerta.plugins': [
19 | 'syslog = alerta_logger:Syslog'
20 | ]
21 | }
22 | )
23 |
--------------------------------------------------------------------------------
/plugins/enhance/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.3'
4 |
5 | setup(
6 | name='alerta-enhance',
7 | version=version,
8 | description='Alerta plugin for alert enhancement',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_enhance'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | entry_points={
18 | 'alerta.plugins': [
19 | 'enhance = alerta_enhance:EnhanceAlert'
20 | ]
21 | }
22 | )
23 |
--------------------------------------------------------------------------------
/plugins/logstash/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.3'
4 |
5 | setup(
6 | name='alerta-logstash',
7 | version=version,
8 | description='Alerta plugin for ELK logstash',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_logstash'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | entry_points={
18 | 'alerta.plugins': [
19 | 'logstash = alerta_logstash:LogStashOutput'
20 | ]
21 | }
22 | )
23 |
--------------------------------------------------------------------------------
/plugins/debug/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '7.0.0'
4 |
5 | setup(
6 | name='alerta-debug',
7 | version=version,
8 | description='Alerta plugin for debug & tracing',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_debug'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | entry_points={
18 | 'alerta.plugins': [
19 | 'debug = alerta_debug:DebugTracing'
20 | ]
21 | },
22 | python_requires='>=3.5'
23 | )
24 |
--------------------------------------------------------------------------------
/plugins/normalise/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.1'
4 |
5 | setup(
6 | name='alerta-normalise',
7 | version=version,
8 | description='Alerta plugin for alert normalisation',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_normalise'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | entry_points={
18 | 'alerta.plugins': [
19 | 'normalise = alerta_normalise:NormaliseAlert'
20 | ]
21 | }
22 | )
23 |
--------------------------------------------------------------------------------
/webhooks/fail2ban/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '1.0.0'
4 |
5 | setup(
6 | name='alerta-fail2ban',
7 | version=version,
8 | description='Alerta Webhook for Fail2Ban',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Milos Buncic',
12 | author_email='milosbuncic@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_fail2ban'],
15 | install_requires=[],
16 | include_package_data=True,
17 | zip_safe=True,
18 | entry_points={
19 | 'alerta.webhooks': [
20 | 'fail2ban = alerta_fail2ban:Fail2BanWebhook'
21 | ]
22 | }
23 | )
24 |
--------------------------------------------------------------------------------
/webhooks/mailgun/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.0'
4 |
5 | setup(
6 | name='alerta-mailgun',
7 | version=version,
8 | description='Alerta webhook for Mailgun',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Anton Delitsch',
12 | author_email='anton@trugen.net',
13 | packages=find_packages(),
14 | py_modules=['alerta_mailgun'],
15 | install_requires=[
16 | ],
17 | include_package_data=True,
18 | zip_safe=True,
19 | entry_points={
20 | 'alerta.webhooks': [
21 | 'mailgun = alerta_mailgun:MailgunWebhook'
22 | ]
23 | }
24 | )
25 |
--------------------------------------------------------------------------------
/webhooks/sentry/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.0'
4 |
5 | setup(
6 | name='alerta-sentry',
7 | version=version,
8 | description='Alerta webhook for Sentry',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_sentry'],
15 | install_requires=[
16 | ],
17 | include_package_data=True,
18 | zip_safe=True,
19 | entry_points={
20 | 'alerta.webhooks': [
21 | 'sentry = alerta_sentry:SentryWebhook'
22 | ]
23 | }
24 | )
25 |
--------------------------------------------------------------------------------
/plugins/goalert/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.3'
4 |
5 | setup(
6 | name='alerta-goalert',
7 | version=version,
8 | description='Alerta plugin for GoAlert',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='SKob',
12 | author_email='skobolo@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_goalert'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'goalert = alerta_goalert:TriggerEvent'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/op5/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.2'
4 |
5 | setup(
6 | name='alerta-op5',
7 | version=version,
8 | description='Alerta plugin for OP5 Monitor',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Anton Delitsch',
12 | author_email='anton@trugen.net',
13 | packages=find_packages(),
14 | py_modules=['alerta_op5'],
15 | install_requires=[
16 | 'op5lib==1.0'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'op5 = alerta_op5:OP5Acknowledge'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/webhooks/query/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '1.0.0'
4 |
5 | setup(
6 | name='alerta-query',
7 | version=version,
8 | description='Alerta Generic Webhook by query parameters',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Pablo Villaverde',
12 | author_email='pvillaverdecastro@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_query'],
15 | install_requires=[],
16 | include_package_data=True,
17 | zip_safe=True,
18 | entry_points={
19 | 'alerta.webhooks': [
20 | 'query = alerta_query:QueryWebhook'
21 | ]
22 | }
23 | )
24 |
--------------------------------------------------------------------------------
/plugins/dingtalk/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '0.0.1'
4 |
5 | setup(
6 | name='alerta-ding',
7 | version=version,
8 | description='Example Alerta plugin for test alerts',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='Apache License 2.0',
11 | author='Komal Gupta',
12 | author_email='komalg038@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_ding'],
15 | install_requires=[],
16 | include_package_data=True,
17 | zip_safe=True,
18 | entry_points={
19 | 'alerta.plugins': [
20 | 'dingtalk = alerta_ding:ServiceIntegration'
21 | ]
22 | }
23 | )
24 |
--------------------------------------------------------------------------------
/plugins/forward/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.0'
4 |
5 | setup(
6 | name='alerta-forward',
7 | version=version,
8 | description='Alerta plugin for forwarding alerts',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='SKob',
12 | author_email='skob@me.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_forward'],
15 | include_package_data=True,
16 | zip_safe=True,
17 | install_requires=[
18 | 'alerta'
19 | ],
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'forward = alerta_forward:ForwardAlert'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/sns/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.1'
4 |
5 | setup(
6 | name='alerta-sns',
7 | version=version,
8 | description='Alerta plugin for AWS SNS',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_sns'],
15 | install_requires=[
16 | 'boto'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'sns = alerta_sns:SnsTopicPublisher'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/geoip/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.4.0'
4 |
5 | setup(
6 | name='alerta-geoip',
7 | version=version,
8 | description='Alerta plugin for GeoIP Lookup',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_geoip'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'geoip = alerta_geoip:GeoLocation'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/slack/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.5.2'
4 |
5 | setup(
6 | name='alerta-slack',
7 | version=version,
8 | description='Alerta plugin for Slack',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_slack'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'slack = alerta_slack:ServiceIntegration'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/zabbix/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.1.2'
4 |
5 | setup(
6 | name='alerta-zabbix',
7 | version=version,
8 | description='Alerta plugin for Zabbix',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_zabbix'],
15 | install_requires=[
16 | 'pyzabbix'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'zabbix = alerta_zabbix:ZabbixEventAck'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/integrations/urlmon/settings.py:
--------------------------------------------------------------------------------
1 | # ENDPOINT = "http://10.0.2.2:8080"
2 | ENDPOINT = 'http://localhost:8080'
3 | API_KEY = None
4 |
5 | checks = [
6 | {
7 | 'resource': 'www.google.com',
8 | 'url': 'http://www.google.com?q=foo#q=foo',
9 | 'environment': 'Production',
10 | 'service': ['Google', 'Search'],
11 | 'api_endpoint': 'http://localhost:8080',
12 | 'api_key': None,
13 | },
14 | {
15 | 'resource': 'guardian-football',
16 | 'url': 'https://www.guardian.co.uk/football',
17 | 'environment': 'Production',
18 | 'service': ['theguardian.com', 'Sport'],
19 | 'tags': ['football'],
20 | 'check_ssl': True
21 | },
22 | ]
23 |
--------------------------------------------------------------------------------
/plugins/alertops/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '1.0.0.1'
4 |
5 | setup(
6 | name='alerta-alertops',
7 | version=version,
8 | description='Alerta plugin for AlertOps',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='AlertOps',
11 | author='Kam Srikanth',
12 | author_email='kamleshs@alertops.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_alertops'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'alertops = alerta_alertops:TriggerEvent'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/opsgenie/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.3'
4 |
5 | setup(
6 | name='alerta-opsgenie',
7 | version=version,
8 | description='Alerta plugin for OpsGenie',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Kurt Westerfeld',
12 | author_email='kurt.westerfeld@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_opsgenie'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'opsgenie = alerta_opsgenie:TriggerEvent'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/webhooks/statuscake/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '0.0.1'
4 |
5 | setup(
6 | name='alerta-statuscake',
7 | version=version,
8 | description='Alerta webhook for statuscake',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='Apache License 2.0',
11 | author='Matthieu Serrepuy',
12 | author_email='matthieu@serrepuy.fr',
13 | packages=find_packages(),
14 | py_modules=['alerta_statuscake'],
15 | install_requires=[],
16 | include_package_data=True,
17 | zip_safe=True,
18 | entry_points={
19 | 'alerta.webhooks': [
20 | 'statuscake = alerta_statuscake:StatusCakeWebhook'
21 | ]
22 | }
23 | )
24 |
--------------------------------------------------------------------------------
/plugins/pushover/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.2'
4 |
5 | setup(
6 | name='alerta-pushover',
7 | version=version,
8 | description='Alerta plugin for Pushover',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_pushover'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'pushover = alerta_pushover:PushMessage'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/webhooks/msteams/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.0'
4 |
5 | setup(
6 | name='alerta-msteamswebhook',
7 | version=version,
8 | description='Alerta webhook for MS Teams',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Jarno Huuskonen',
12 | author_email='jjh74@users.noreply.github.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_msteamswebhook'],
15 | install_requires=[
16 | ],
17 | include_package_data=True,
18 | zip_safe=True,
19 | entry_points={
20 | 'alerta.webhooks': [
21 | 'msteams = alerta_msteamswebhook:MsteamsWebhook'
22 | ]
23 | }
24 | )
25 |
--------------------------------------------------------------------------------
/plugins/amqp/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.4.1'
4 |
5 | setup(
6 | name='alerta-amqp',
7 | version=version,
8 | description='Alerta plugin for AMQP messaging',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_amqp'],
15 | install_requires=[
16 | 'kombu',
17 | 'pytz'
18 | ],
19 | include_package_data=True,
20 | zip_safe=True,
21 | entry_points={
22 | 'alerta.plugins': [
23 | 'amqp = alerta_amqp:FanoutPublisher'
24 | ]
25 | }
26 | )
27 |
--------------------------------------------------------------------------------
/plugins/influxdb/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.4.3'
4 |
5 | setup(
6 | name='alerta-influxdb',
7 | version=version,
8 | description='Alerta plugin for InfluxDB',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_influxdb'],
15 | install_requires=[
16 | 'influxdb>=5.0.0'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'influxdb = alerta_influxdb:InfluxDBWrite'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/pagerduty/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.3.1'
4 |
5 | setup(
6 | name='alerta-pagerduty',
7 | version=version,
8 | description='Alerta plugin for PagerDuty',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_pagerduty'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'pagerduty = alerta_pagerduty:TriggerEvent'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/rocketchat/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.0'
4 |
5 | setup(
6 | name='alerta-rocketchat',
7 | version=version,
8 | description='Alerta plugin for Rocket.Chat',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_rocketchat'],
15 | install_requires=[
16 | 'requests'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'rocketchat = alerta_rocketchat:PostMessage'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/timeout/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '4.0.3'
4 |
5 | setup(
6 | name='alerta-timeout',
7 | version=version,
8 | description='Alerta plugin to permit a global custom timeout to be supplied via alerta config',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Thomas Collins',
12 | author_email='thomaswcollins@gmail.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_timeout'],
15 | install_requires=[],
16 | include_package_data=True,
17 | zip_safe=True,
18 | entry_points={
19 | 'alerta.plugins': [
20 | 'timeout = alerta_timeout:Timeout'
21 | ]
22 | }
23 | )
24 |
--------------------------------------------------------------------------------
/plugins/cachet/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.1'
4 |
5 | setup(
6 | name='alerta-cachet',
7 | version=version,
8 | description='Alerta plugin for Cachet status page',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_cachet'],
15 | install_requires=[
16 | 'python-cachetclient'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'cachet = alerta_cachet:CachetIncident'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/mattermost/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '1.1.3'
4 |
5 | setup(
6 | name='alerta-mattermost',
7 | version=version,
8 | description='Alerta plugin for Mattermost',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Dmitrii Sitnikov (WWHW)',
12 | author_email='no-reply@wwhw.org',
13 | packages=find_packages(),
14 | py_modules=['alerta_mattermost'],
15 | install_requires=[
16 | 'matterhook',
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'mattermost = alerta_mattermost:ServiceIntegration'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/telegram/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.1.3'
4 |
5 | setup(
6 | name='alerta-telegram',
7 | version=version,
8 | description='Alerta plugin for Telegram',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_telegram'],
15 | install_requires=[
16 | 'telepot',
17 | 'jinja2'
18 | ],
19 | include_package_data=True,
20 | zip_safe=True,
21 | entry_points={
22 | 'alerta.plugins': [
23 | 'telegram = alerta_telegram:TelegramBot'
24 | ]
25 | }
26 | )
27 |
--------------------------------------------------------------------------------
/plugins/msteams/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.2.1'
4 |
5 | setup(
6 | name='alerta-msteams',
7 | version=version,
8 | description='Alerta plugin for Microsoft Teams',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Anton Delitsch',
12 | author_email='anton@trugen.net',
13 | packages=find_packages(),
14 | py_modules=['alerta_msteams'],
15 | install_requires=[
16 | 'pymsteams',
17 | 'jinja2'
18 | ],
19 | include_package_data=True,
20 | zip_safe=True,
21 | entry_points={
22 | 'alerta.plugins': [
23 | 'msteams = alerta_msteams:SendConnectorCardMessage'
24 | ]
25 | }
26 | )
27 |
--------------------------------------------------------------------------------
/webhooks/azuremonitor/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.0.2'
4 |
5 | setup(
6 | name='alerta-azure-monitor',
7 | version=version,
8 | description='Alerta webhook for Azure Monitor',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Anton Delitsch',
12 | author_email='anton@trugen.net',
13 | packages=find_packages(),
14 | py_modules=['alerta_azuremonitor'],
15 | install_requires=[
16 | 'python-dateutil'
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.webhooks': [
22 | 'azuremonitor = alerta_azuremonitor:AzureMonitorWebhook'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/plugins/pubsub/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.2.2'
4 |
5 | setup(
6 | name='alerta-pubsub',
7 | version=version,
8 | description='Alerta plugin for sending alerts to pubsub',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Arindam Choudhury',
12 | author_email='arindam@live.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_pubsub'],
15 | install_requires=[
16 | 'google-cloud-pubsub',
17 | 'oauth2client',
18 | 'grpcio==1.30.0'
19 | ],
20 | include_package_data=True,
21 | zip_safe=True,
22 | entry_points={
23 | 'alerta.plugins': [
24 | 'pubsub = alerta_pubsub:SendToPubsub'
25 | ]
26 | }
27 | )
28 |
--------------------------------------------------------------------------------
/plugins/timeout/alerta_timeout.py:
--------------------------------------------------------------------------------
1 | import logging
2 | import os
3 |
4 | from alerta.plugins import PluginBase
5 |
6 | try:
7 | from alerta.plugins import app # alerta >= 5.0
8 | except ImportError:
9 | from alerta.app import app # alerta < 5.0
10 |
11 | LOG = logging.getLogger('alerta.plugins.timeout')
12 |
13 | TIMEOUT = os.environ.get('ALERT_TIMEOUT') or app.config.get(
14 | 'ALERT_TIMEOUT', '2600')
15 |
16 |
17 | class Timeout(PluginBase):
18 |
19 | def pre_receive(self, alert):
20 |
21 | LOG.debug('Setting timeout for alert to %s ', TIMEOUT)
22 | alert.timeout = TIMEOUT
23 |
24 | return alert
25 |
26 | def post_receive(self, alert):
27 | return
28 |
29 | def status_change(self, alert, status, text):
30 | return
31 |
--------------------------------------------------------------------------------
/plugins/prometheus/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.4.0'
4 |
5 | setup(
6 | name='alerta-prometheus',
7 | version=version,
8 | description='Alerta plugin for Prometheus Alertmanager',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_prometheus'],
15 | install_requires=[
16 | 'requests',
17 | 'alerta-server>=4.10.1'
18 | ],
19 | include_package_data=True,
20 | zip_safe=True,
21 | entry_points={
22 | 'alerta.plugins': [
23 | 'prometheus = alerta_prometheus:AlertmanagerSilence'
24 | ]
25 | }
26 | )
27 |
--------------------------------------------------------------------------------
/integrations/snmptrap/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import setuptools
4 |
5 | setuptools.setup(
6 | name='alerta-snmptrap',
7 | version='5.0.0',
8 | description='Alerta script for SNMP traps',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | py_modules=['handler'],
14 | install_requires=[
15 | 'alerta'
16 | ],
17 | include_package_data=True,
18 | zip_safe=False,
19 | entry_points={
20 | 'console_scripts': [
21 | 'alerta-snmptrap = handler:main'
22 | ]
23 | },
24 | keywords='alerta snmp trap monitoring',
25 | classifiers=[
26 | 'Topic :: System :: Monitoring',
27 | ]
28 | )
29 |
--------------------------------------------------------------------------------
/plugins/twilio/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages, setup
2 |
3 | version = '5.4.0'
4 |
5 | setup(
6 | name='alerta-twilio',
7 | version=version,
8 | description='Alerta plugin for Twilio SMS',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Nick Satterly',
12 | author_email='nick.satterly@theguardian.com',
13 | packages=find_packages(),
14 | py_modules=['alerta_twilio_sms'],
15 | install_requires=[
16 | 'twilio>=6.0.0,<6.51.0' # See https://github.com/twilio/twilio-python/issues/556
17 | ],
18 | include_package_data=True,
19 | zip_safe=True,
20 | entry_points={
21 | 'alerta.plugins': [
22 | 'twilio_sms = alerta_twilio_sms:SendSMSMessage'
23 | ]
24 | }
25 | )
26 |
--------------------------------------------------------------------------------
/integrations/urlmon/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import setuptools
4 |
5 | version = '3.3.0'
6 |
7 | setuptools.setup(
8 | name='alerta-urlmon',
9 | version=version,
10 | description='Alerta script for URL monitoring',
11 | url='https://github.com/alerta/alerta-contrib',
12 | license='MIT',
13 | author='Nick Satterly',
14 | author_email='nick.satterly@theguardian.com',
15 | py_modules=['urlmon'],
16 | install_requires=[
17 | 'alerta'
18 | ],
19 | include_package_data=True,
20 | zip_safe=False,
21 | entry_points={
22 | 'console_scripts': [
23 | 'alerta-urlmon = urlmon:main'
24 | ]
25 | },
26 | keywords='alerta url monitoring',
27 | classifiers=[
28 | 'Topic :: System :: Monitoring',
29 | ]
30 | )
31 |
--------------------------------------------------------------------------------
/integrations/syslog/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import setuptools
4 |
5 | version = '3.5.0'
6 |
7 | setuptools.setup(
8 | name='alerta-syslog',
9 | version=version,
10 | description='Alerta script for Syslog messages',
11 | url='https://github.com/alerta/alerta-contrib',
12 | license='MIT',
13 | author='Nick Satterly',
14 | author_email='nick.satterly@theguardian.com',
15 | py_modules=['syslogfwder'],
16 | install_requires=[
17 | 'alerta'
18 | ],
19 | include_package_data=True,
20 | zip_safe=False,
21 | entry_points={
22 | 'console_scripts': [
23 | 'alerta-syslog = syslogfwder:main'
24 | ]
25 | },
26 | keywords='alerta syslog monitoring',
27 | classifiers=[
28 | 'Topic :: System :: Monitoring',
29 | ]
30 | )
31 |
--------------------------------------------------------------------------------
/integrations/sqs/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import setuptools
4 |
5 | version = '3.3.0'
6 |
7 | setuptools.setup(
8 | name='alerta-sqs',
9 | version=version,
10 | description='Alerta integration for AWS SQS',
11 | url='https://github.com/alerta/alerta-contrib',
12 | license='MIT',
13 | author='Nick Satterly',
14 | author_email='nick.satterly@theguardian.com',
15 | py_modules=['alerta_sqs'],
16 | install_requires=[
17 | 'alerta',
18 | 'boto'
19 | ],
20 | include_package_data=True,
21 | zip_safe=False,
22 | entry_points={
23 | 'console_scripts': [
24 | 'alerta-sqs = alerta_sqs:main'
25 | ]
26 | },
27 | keywords='alerta monitoring amazon sqs',
28 | classifiers=[
29 | 'Topic :: System :: Monitoring',
30 | ]
31 | )
32 |
--------------------------------------------------------------------------------
/plugins/normalise/alerta_normalise.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from alerta.plugins import PluginBase
4 |
5 | LOG = logging.getLogger('alerta.plugins.normalise')
6 |
7 |
8 | class NormaliseAlert(PluginBase):
9 |
10 | def pre_receive(self, alert):
11 |
12 | LOG.info('Normalising alert...')
13 |
14 | # prepend severity to alert text
15 | alert.text = '{}: {}'.format(alert.severity.upper(), alert.text)
16 |
17 | # supply different default values if missing
18 | if not alert.group or alert.group == 'Misc':
19 | alert.group = 'Unknown'
20 | if not alert.value or alert.value == 'n/a':
21 | alert.value = '--'
22 |
23 | return alert
24 |
25 | def post_receive(self, alert):
26 | return
27 |
28 | def status_change(self, alert, status, text):
29 | return
30 |
--------------------------------------------------------------------------------
/integrations/consul/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup
2 |
3 | version = '1.1.1'
4 |
5 | setup(
6 | name='alerta-consul',
7 | version=version,
8 | description='Send emails from Alerta',
9 | url='https://github.com/alerta/alerta-contrib',
10 | license='MIT',
11 | author='Marco Supino',
12 | author_email='marco@supino.org',
13 | py_modules=['consulalerta', 'consulheartbeat'],
14 | install_requires=[
15 | 'alerta',
16 | 'python-consul'
17 | ],
18 | include_package_data=True,
19 | zip_safe=False,
20 | entry_points={
21 | 'console_scripts': [
22 | 'consul-alerta = consulalerta:main',
23 | 'consul-heartbeat = consulheartbeat:main'
24 | ]
25 | },
26 | keywords='alerta monitoring consul',
27 | classifiers=[
28 | 'Topic :: System :: Monitoring',
29 | ]
30 | )
31 |
--------------------------------------------------------------------------------
/integrations/pinger/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup
2 |
3 | setup(
4 | name='alerta-pinger',
5 | version='3.3.0',
6 | description='Alerta Pinger daemon',
7 | license='MIT',
8 | author='Nick Satterly',
9 | author_email='nick.satterly@theguardian.com',
10 | url='http://github.com/alerta/alerta-contrib',
11 | py_modules=['pinger'],
12 | install_requires=[
13 | 'alerta',
14 | 'PyYaml'
15 | ],
16 | entry_points={
17 | 'console_scripts': [
18 | 'alerta-pinger = pinger:main'
19 | ]
20 | },
21 | keywords='alerta ping daemon',
22 | classifiers=[
23 | 'Development Status :: 5 - Production/Stable',
24 | 'License :: OSI Approved :: MIT License',
25 | 'Intended Audience :: System Administrators',
26 | 'Programming Language :: Python :: 2.6',
27 | 'Programming Language :: Python :: 2.7',
28 | 'Topic :: System :: Monitoring',
29 | ]
30 | )
31 |
--------------------------------------------------------------------------------
/plugins/goalert/README.md:
--------------------------------------------------------------------------------
1 | Goalert Plugin
2 | ================
3 |
4 | Send goalert messages for new alerts.
5 |
6 | Installation
7 | ------------
8 |
9 | Clone the GitHub repo and run:
10 |
11 | $ python setup.py install
12 |
13 | Or, to install remotely from GitHub run:
14 |
15 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/goalert
16 |
17 | Note: If Alerta is installed in a python virtual environment then plugins
18 | need to be installed into the same environment for Alerta to dynamically
19 | discover them.
20 |
21 | Configuration
22 | -------------
23 |
24 | Add `goalert` to the list of enabled `PLUGINS` in `alertad.conf` server
25 | configuration file and set plugin-specific variables either in the
26 | server configuration file or as environment variables.
27 |
28 | Add some configs to `alertad.conf`:
29 | ```
30 | GOALERT_URL = 'https://alerta.example'
31 | GOALERT_TOKEN = 'secret key'
32 | GOALERT_VERIFY = '/usr/local/share/ca-certificates/ca.crt' # or False
33 | ```
34 |
--------------------------------------------------------------------------------
/integrations/mailer/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import setuptools
4 |
5 | version = '5.2.1'
6 |
7 | setuptools.setup(
8 | name='alerta-mailer',
9 | version=version,
10 | description='Send emails from Alerta',
11 | url='https://github.com/alerta/alerta-contrib',
12 | license='MIT',
13 | author='Nick Satterly',
14 | author_email='nick.satterly@theguardian.com',
15 | py_modules=['mailer'],
16 | data_files=[('.', ['email.tmpl', 'email.html.tmpl'])],
17 | setup_requires=['pytest-runner'],
18 | tests_require=['pytest', 'mock', 'pytest-capturelog'],
19 | install_requires=[
20 | 'alerta>=5.0.2',
21 | 'kombu',
22 | 'redis',
23 | 'jinja2'
24 | ],
25 | include_package_data=True,
26 | zip_safe=False,
27 | entry_points={
28 | 'console_scripts': [
29 | 'alerta-mailer = mailer:main'
30 | ]
31 | },
32 | keywords='alerta monitoring mailer sendmail smtp',
33 | classifiers=[
34 | 'Topic :: System :: Monitoring',
35 | ]
36 | )
37 |
--------------------------------------------------------------------------------
/plugins/enhance/alerta_enhance.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from alerta.plugins import PluginBase
4 |
5 | LOG = logging.getLogger('alerta.plugins.enhance')
6 |
7 | RUNBOOK_URL = 'http://www.example.com/wiki/RunBook' # example only
8 |
9 |
10 | class EnhanceAlert(PluginBase):
11 |
12 | def pre_receive(self, alert):
13 |
14 | LOG.info('Enhancing alert...')
15 |
16 | # Set "isOutOfHours" flag for later use by notification plugins
17 | dayOfWeek = alert.create_time.strftime('%a')
18 | hourOfDay = alert.create_time.hour
19 | if dayOfWeek in ['Sat', 'Sun'] or 8 > hourOfDay > 18:
20 | alert.attributes['isOutOfHours'] = True
21 | else:
22 | alert.attributes['isOutOfHours'] = False
23 |
24 | # Add link to Run Book based on event name
25 | alert.attributes['runBookUrl'] = '{}/{}'.format(
26 | RUNBOOK_URL, alert.event.replace(' ', '-'))
27 |
28 | return alert
29 |
30 | def post_receive(self, alert):
31 | return
32 |
33 | def status_change(self, alert, status, text):
34 | return
35 |
--------------------------------------------------------------------------------
/integrations/sqs/README.md:
--------------------------------------------------------------------------------
1 | Amazon SQS Integration
2 | ======================
3 |
4 | Subscribe to SQS queue of alerts.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=integrations/sqs
18 |
19 | Configuration
20 | -------------
21 |
22 | ```python
23 | AWS_ACCESS_KEY_ID = '' # default="not set"
24 | AWS_SECRET_ACCESS_KEY = '' # default="not set"
25 | ```
26 |
27 | **Default Configuration**
28 |
29 | ```python
30 | AWS_REGION = 'eu-west-1"' # default="eu-west-1"
31 | AWS_SQS_QUEUE = 'alerts'
32 | ```
33 |
34 | Troubleshooting
35 | ---------------
36 |
37 | TBC
38 |
39 | References
40 | ----------
41 |
42 | * Amazon Web Services SQS: https://aws.amazon.com/sqs/getting-started/
43 |
44 | License
45 | -------
46 |
47 | Copyright (c) 2016 Nick Satterly. Available under the MIT License.
48 |
--------------------------------------------------------------------------------
/webhooks/fail2ban/alerta_fail2ban.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | from alerta.models.alert import Alert
4 | from alerta.webhooks import WebhookBase
5 |
6 |
7 | class Fail2BanWebhook(WebhookBase):
8 |
9 | def incoming(self, query_string, payload):
10 |
11 | # Default parameters
12 | environment = 'Production'
13 | severity = 'security'
14 | group = 'Fail2Ban'
15 | text = ''
16 | tags = []
17 | attributes = {}
18 | origin = ''
19 |
20 | return Alert(
21 | resource=payload['resource'],
22 | event=payload['event'],
23 | environment=payload.get('environment', environment),
24 | severity=payload.get('severity', severity),
25 | service=['fail2ban'],
26 | group=payload.get('group', group),
27 | value='BAN',
28 | text=payload.get('message', text),
29 | tags=payload.get('tags', tags),
30 | attributes=payload.get('attributes', attributes),
31 | origin=payload.get('hostname', origin),
32 | raw_data=json.dumps(payload, indent=4)
33 | )
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2014-2017 Nick Satterly and AUTHORS
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/integrations/pinger/README.md:
--------------------------------------------------------------------------------
1 | Pinger Integration
2 | ==================
3 |
4 | Monitor network availability using ICMP Ping and generate alerts on failures.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=integrations/pinger
18 |
19 | Configuration
20 | -------------
21 |
22 | Add "ping targets" to `alerta-pinger.targets` in the following format:
23 |
24 | ```yaml
25 | ---
26 | - environment: Production
27 | service: [Web]
28 | targets:
29 | - search.twitter.com
30 | - www.nytimes.com
31 | - www.google.com
32 | - www.nyc.gov
33 | - newyork.yankees.mlb.com
34 | ```
35 |
36 | References
37 | ----------
38 |
39 | * RFC792 Internet Control Message Protocol: https://tools.ietf.org/html/rfc792
40 |
41 | License
42 | -------
43 |
44 | Copyright (c) 2014-2016 Nick Satterly. Available under the MIT License.
45 |
--------------------------------------------------------------------------------
/integrations/supervisor/README.md:
--------------------------------------------------------------------------------
1 | Supervisor Integration
2 | ======================
3 |
4 | Trigger alerts and heartbeats based on process `supervisor` [events][1].
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=integrations/supervisor
18 |
19 | Configuration
20 | -------------
21 |
22 | Copy the example configuration file `supervisord.conf.example` to `/etc`
23 | and modify for your environment:
24 |
25 | $ sudo cp supervisord.conf.example /etc/supervisord.conf
26 | $ sudo vi /etc/supervisord.conf
27 | $ sudo supervisord
28 |
29 |
30 | Troubleshooting
31 | ---------------
32 |
33 | $ sudo supervisord -c supervisord.conf.example -n
34 |
35 | References
36 | ----------
37 |
38 | * supervisord Events: http://supervisord.org/events.html
39 |
40 | License
41 | -------
42 |
43 | Copyright (c) 2015-2016 Nick Satterly. Available under the MIT License.
44 |
--------------------------------------------------------------------------------
/plugins/debug/README.md:
--------------------------------------------------------------------------------
1 | Debug Plugin
2 | ============
3 |
4 | Used for debugging only.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/debug
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `debug` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 |
30 | ```python
31 | PLUGINS = ['debug']
32 | ```
33 |
34 | **Example Configuration**
35 |
36 | ```python
37 | DEBUG = True
38 | ```
39 |
40 | References
41 | ----------
42 |
43 | n/a
44 |
45 | License
46 | -------
47 |
48 | Copyright (c) 2019 Nick Satterly. Available under the MIT License.
49 |
--------------------------------------------------------------------------------
/webhooks/mailgun/README.md:
--------------------------------------------------------------------------------
1 | Mailgun incomming email Webhook
2 | ==============
3 |
4 | Receive Emails using [Mailgun](https://documentation.mailgun.com/en/latest/quickstart-receiving.html) webhook callbacks.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/mailgun
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | The custom webhook receive incomming emails sent to an Mailgun account.
27 |
28 | 
29 |
30 |
31 | References
32 | ----------
33 |
34 | * Mailgun: https://documentation.mailgun.com/en/latest/quickstart-receiving.html
35 |
36 | License
37 | -------
38 |
39 | Copyright (c) 2018 Anton Delitsch. Available under the MIT License.
40 |
--------------------------------------------------------------------------------
/integrations/mailer/email.tmpl:
--------------------------------------------------------------------------------
1 |
2 | ------------------------------------------------------------
3 | [{{ alert.status|title }}] {{ alert.environment }}: {{ alert.severity|title }} {{ alert.event }} on {{ alert.service|join(', ') }} {{ alert.resource }}
4 | ------------------------------------------------------------
5 |
6 | Alert ID: {{ alert.id }}
7 | Create Time: {{ alert.create_time }}
8 | Environment: {{ alert.environment }}
9 | Services: {{ alert.service|join(', ') }}
10 | Resource: {{ alert.resource }}
11 | Event: {{ alert.event }}
12 | Group: {{ alert.group }}
13 | Value: {{ alert.value }}
14 | Severity: {{ alert.previous_severity|title}} -> {{ alert.severity|title }}
15 | Status: {{ alert.status|title }}
16 | Text: {{ alert.text }}
17 | Duplicate Count: {{ alert.duplicate_count }}
18 | Origin: {{ alert.origin }}
19 | Tags: {{ alert.tags|join(', ') }}
20 | {% for key,value in alert.attributes.items() -%}
21 | {{ key|title }}: {{ value }}
22 | {% endfor -%}
23 |
24 | {% if alert.raw_data %}
25 | Raw Data
26 | {{ alert.raw_data }}
27 | {% endif %}
28 |
29 | To acknowledge this alert visit this URL:
30 | {{ dashboard_url }}/#/alert/{{ alert.id }}
31 |
32 | Generated by {{ program }} on {{ hostname }} at {{ now }}
33 |
--------------------------------------------------------------------------------
/integrations/consul/consulheartbeat.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import time
4 |
5 | import consul
6 | from alertaclient.api import Client
7 |
8 | client = consul.Consul(host='127.0.0.1', port=8500, token=None,
9 | scheme='http', consistency='default', dc=None, verify=True)
10 |
11 | url = client.kv.get('alerta/apiurl')[1]['Value']
12 | key = client.kv.get('alerta/apikey')[1]['Value']
13 |
14 | max_retries = int(client.kv.get('alerta/max_retries')[1]['Value'])
15 | sleep = int(client.kv.get('alerta/sleep')[1]['Value'])
16 | timeout = int(client.kv.get('alerta/timeout')[1]['Value'])
17 |
18 | origin = client.kv.get('alerta/origin')[1]['Value']
19 | api = Client(endpoint=url, key=key)
20 |
21 |
22 | def createheartbeat():
23 | for _ in range(max_retries):
24 | try:
25 | print(api.heartbeat(origin=origin, timeout=timeout))
26 | except Exception as e:
27 | print('HTTP Error: {}'.format(e))
28 | time.sleep(sleep)
29 | continue
30 | else:
31 | break
32 | else:
33 | print('api is down')
34 |
35 |
36 | def main():
37 | createheartbeat()
38 |
39 |
40 | if __name__ == '__main__':
41 | main()
42 |
--------------------------------------------------------------------------------
/webhooks/mailgun/alerta_mailgun.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | from alerta.models.alert import Alert
4 | from alerta.webhooks import WebhookBase
5 |
6 |
7 | class MailgunWebhook(WebhookBase):
8 |
9 | def incoming(self, query_string, payload):
10 |
11 | # Load variables from querystring
12 | try:
13 | environment = query_string['environment']
14 | except Exception:
15 | environment = 'Production'
16 | try:
17 | severity = query_string['severity']
18 | except Exception:
19 | severity = 'major'
20 | try:
21 | group = query_string['group']
22 | except Exception:
23 | group = 'Email'
24 |
25 | return Alert(
26 | resource=payload['sender'],
27 | type='Email Alert',
28 | event=payload['subject'],
29 | environment=environment,
30 | severity=severity,
31 | service=['Email'],
32 | group=group,
33 | text=payload['stripped-text'] or payload['body-plain'],
34 | tags=[],
35 | attributes={},
36 | origin='Mailgun/{}'.format(payload['recipient']),
37 | raw_data=json.dumps(payload, indent=4)
38 | )
39 |
--------------------------------------------------------------------------------
/webhooks/statuscake/README.md:
--------------------------------------------------------------------------------
1 | Statuscake Webhook
2 | ==============
3 |
4 | Receive [Statuscake](https://www.statuscake.com) alerts via webhook callbacks.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/statuscake
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | The custom webhook will be auto-detected and added to the list of available API endpoints.
27 |
28 | Add the Alerta API webhook URL in the Statuscake contact group webhook section
29 |
30 | 
31 |
32 |
33 | References
34 | ----------
35 |
36 | * StatusCake Webhook: https://www.statuscake.com/kb/knowledge-base/how-to-use-the-web-hook-url/
37 |
38 | License
39 | -------
40 |
41 | Copyright (c) 2020 Matthieu Serrepuy. Available under the MIT License.
42 |
--------------------------------------------------------------------------------
/plugins/forward/README.md:
--------------------------------------------------------------------------------
1 | Forward Plugin
2 | ========================
3 |
4 | This is an plugin that forward alert from one server to another.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/forward
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `forward` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 |
30 | ```python
31 | PLUGINS = ['forward']
32 | ```
33 |
34 | **Example**
35 |
36 | ```python
37 | PLUGINS = ['enhance', 'forward']
38 | FORWARD_URL = 'http://www.example.com/api'
39 | FORWARD_API_KEY = 'client_api_key'
40 | FORWARD_MAX_LENGTH = 3 # cycle detector
41 | ```
42 |
43 | Copyright (c) 2018 SKob. Available under the MIT License.
44 |
--------------------------------------------------------------------------------
/webhooks/query/README.md:
--------------------------------------------------------------------------------
1 | Query Webhook
2 | ==============
3 |
4 | Receive Alerts using only query parameters by webhook. For those apps or use cases when you can't specify a payload or body to the query and just one to send all by query parameters.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/query
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | You can specify all the parameters on the query except Attributes for the moment.
27 | https://[ALERTA-URL]/api/webhooks/query?api-key=[YOUR-API-KEY]&service=TheForce&severity=critical&resource=Alderaan&event=SomethingTerribleHappened&text=AGreatDisturbanceInTheForce&tags=Force,Alderaan,DeathStar&origin=ObiWanKenobi&group=Jedi&timeout=300
28 |
29 | References
30 | ----------
31 |
32 | * Based on the other Alerta-Contrib plugins.
33 |
34 | License
35 | -------
36 |
37 | Copyright (c) 2021 Pablo Villaverde. Available under the MIT License.
38 |
--------------------------------------------------------------------------------
/plugins/forward/alerta_forward.py:
--------------------------------------------------------------------------------
1 | import logging
2 | import os
3 |
4 | from alerta.plugins import PluginBase
5 | from alertaclient.api import Client
6 |
7 | try:
8 | from alerta.plugins import app # alerta >= 5.0
9 | except ImportError:
10 | from alerta.app import app # alerta < 5.0
11 |
12 | LOG = logging.getLogger('alerta.plugins.forward')
13 |
14 | FORWARD_URL = os.environ.get(
15 | 'FORWARD_URL') or app.config.get('FORWARD_URL')
16 | FORWARD_API_KEY = os.environ.get(
17 | 'FORWARD_API_KEY') or app.config.get('FORWARD_API_KEY')
18 | FORWARD_MAX_LENGTH = os.environ.get(
19 | 'FORWARD_MAX_LENGTH') or app.config.get('FORWARD_MAX_LENGTH') or 3
20 |
21 |
22 | class ForwardAlert(PluginBase):
23 |
24 | def pre_receive(self, alert):
25 | return alert
26 |
27 | def post_receive(self, alert):
28 | if not FORWARD_URL or not FORWARD_API_KEY:
29 | return
30 | client = Client(endpoint=FORWARD_URL, key=FORWARD_API_KEY)
31 | fw_count = alert.attributes.get('fw_count') or 0
32 | fw_count = fw_count + 1
33 | if fw_count >= FORWARD_MAX_LENGTH:
34 | LOG.debug('alert discarded by cycle overflow')
35 | return
36 |
37 | alert.attributes['fw_count'] = fw_count
38 | client.send_alert(
39 | **alert.serialize
40 | )
41 | return
42 |
43 | def status_change(self, alert, status, text):
44 | return
45 |
--------------------------------------------------------------------------------
/integrations/mailer/email.html.tmpl:
--------------------------------------------------------------------------------
1 |
2 | [{{ alert.status|title }}] {{ alert.environment }}: {{ alert.severity|title }} {{ alert.event }} on {{ alert.service|join(', ') }} {{ alert.resource }}
3 |
4 |
5 | Alert ID: {{ alert.id }}
6 | Create Time: {{ alert.create_time }}
7 | Environment: {{ alert.environment }}
8 | Services: {{ alert.service|join(', ') }}
9 | Resource: {{ alert.resource }}
10 | Event: {{ alert.event }}
11 | Group: {{ alert.group }}
12 | Value: {{ alert.value }}
13 | Severity: {{ alert.previous_severity|title}} -> {{ alert.severity|title }}
14 | Status: {{ alert.status|title }}
15 | Text: {{ alert.text }}
16 | Duplicate Count: {{ alert.duplicate_count }}
17 | Origin: {{ alert.origin }}
18 | Tags: {{ alert.tags|join(', ') }}
19 | {% for key,value in alert.attributes.items() -%}
20 | {{ key|title }}: {{ value }}
21 | {% endfor -%}
22 |
23 | {% if alert.raw_data %}
24 | Raw Data
25 | {{ alert.raw_data }}
26 | {% endif %}
27 |
28 |
29 |
30 | To acknowledge this alert visit this URL
31 |
32 |
33 | Generated by {{ program }} on {{ hostname }} at {{ now }}
34 |
--------------------------------------------------------------------------------
/webhooks/sentry/alerta_sentry.py:
--------------------------------------------------------------------------------
1 | from alerta.models.alert import Alert
2 | from alerta.webhooks import WebhookBase
3 |
4 |
5 | class SentryWebhook(WebhookBase):
6 |
7 | def incoming(self, query_string, payload):
8 |
9 | # For Sentry v9
10 | # Defaults to value before Sentry v9
11 | if 'request' in payload.get('event'):
12 | key = 'request'
13 | else:
14 | key = 'sentry.interfaces.Http'
15 |
16 | if payload.get('event')[key]['env']['ENV'] == 'prod':
17 | environment = 'Production'
18 | else:
19 | environment = 'Development'
20 |
21 | if payload['level'] == 'error':
22 | severity = 'critical'
23 | else:
24 | severity = 'ok'
25 |
26 | return Alert(
27 | resource=payload['culprit'],
28 | event=payload['event']['event_id'],
29 | environment=environment,
30 | severity=severity,
31 | service=[payload['project']],
32 | group='Application',
33 | value=payload['level'],
34 | text='{} {}'.format(payload['message'], payload['url']),
35 | tags=['{}={}'.format(k, v) for k, v in payload['event']['tags']],
36 | attributes={'modules': ['{}=={}'.format(
37 | k, v) for k, v in payload['event']['modules'].items()]},
38 | origin='sentry.io',
39 | raw_data=str(payload)
40 | )
41 |
--------------------------------------------------------------------------------
/integrations/fail2ban/fail2ban-alerta.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Author: Milos Buncic
3 | # Date: 2018/12/01
4 | # Description: Send Alerta event if user exist but invalid password is used
5 |
6 | # Example: https://alerta.example.com/api/webhooks/fail2ban
7 | ALERTA_URL=${1}
8 | # API key has to be generated on the Alerta side
9 | # Example: EXdp3haf4Xkk7Dpk5MFrqfafn6nYGgtz4JL4XzBY
10 | ALERTA_API_KEY=${2}
11 |
12 | # Will be passed to by fail2ban as action tags (see alerta.conf):
13 | BANNED_IP=${3}
14 | FAILURES=${4}
15 | LOGPATH=${5}
16 |
17 | if [[ ${#} -ne 5 ]]; then
18 | echo "Usage: $(basename ${0}) alerta_url alerta_api_key banned_ip failures logpath"
19 | exit 1
20 | fi
21 |
22 | MSG=$(egrep "\[[0-9]*?\]: Failed password for [a-z][-a-z0-9_]* from ${BANNED_IP}" ${LOGPATH} | tail -1)
23 | BANNED_USER=$(echo ${MSG} | awk '{print $9}')
24 | FQDN=$(hostname -f)
25 |
26 | curl -sSL -X POST -H "X-API-Key: ${ALERTA_API_KEY}" -H "Content-Type: application/json" -d \
27 | '
28 | {
29 | "hostname": "'${FQDN}'",
30 | "attributes": {
31 | "bannedIp": "'${BANNED_IP}'",
32 | "bannedUser": "'${BANNED_USER}'"
33 | },
34 | "severity": "warning",
35 | "environment": "Development",
36 | "resource": "sshd",
37 | "event": "The IP '${BANNED_IP}' has just been banned by Fail2Ban after '${FAILURES}' attempts!",
38 | "message": "'"${MSG}"'"
39 | }
40 | ' \
41 | ${ALERTA_URL}
42 |
--------------------------------------------------------------------------------
/integrations/fail2ban/README.md:
--------------------------------------------------------------------------------
1 | Fail2Ban
2 | ========
3 |
4 | Send Alerta event (alarm) if source IP is banned (valid user is using invalid password via SSHD or SFTP).
5 |
6 | Configuration
7 | -------------
8 |
9 | Alerta webhook module and documentation can be found [here](../../webhooks/fail2ban)
10 |
11 | Clone git repo on the server where `fail2ban` is installed and execute following commands as root:
12 |
13 | Copy action script
14 |
15 | ```bash
16 | cp -a fail2ban-alerta.sh /usr/local/bin/
17 | chown root:root /usr/local/bin/fail2ban-alerta.sh
18 | chmod +x /usr/local/bin/fail2ban-alerta.sh
19 | ```
20 |
21 | Copy `fail2ban` action configuration file
22 |
23 | ```bash
24 | cp -a alerta.conf /etc/fail2ban/action.d/
25 | chown root:root /etc/fail2ban/action.d/alerta.conf
26 | ```
27 |
28 | Modify configuration of `sshd` jail in the existing `/etc/fail2ban/jail.local` file by adding additional `alerta` action,
29 | also be sure to modify action input parameters accordingly (`alertaurl` and `alertaapikey`).
30 |
31 | **Note:** Example [jail.local](./jail.local) file is also provided
32 |
33 | ```plain
34 | [sshd]
35 |
36 | enabled = true
37 | port = ssh
38 | logpath = %(sshd_log)s
39 | action = %(action_mwl)s
40 | alerta[alertaurl=https://alerta.example.com/api/webhooks/fail2ban, alertaapikey=EXdp3haf4Xkk7Dpk5MFrqfafn6nYGgtz4JL4XzBY]
41 | maxretry = 4
42 | ```
43 |
44 | Restart `fail2ban` service
45 |
46 | ```plain
47 | systemctl restart fail2ban
48 | ```
49 |
--------------------------------------------------------------------------------
/plugins/amqp/listener.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from kombu import Connection, Exchange, Queue
4 | from kombu.mixins import ConsumerMixin
5 |
6 | AMQP_URL = 'mongodb://localhost:27017/kombu'
7 | AMQP_TOPIC = 'notify'
8 |
9 |
10 | class FanoutConsumer(ConsumerMixin):
11 | def __init__(self, conn):
12 | self.connection = conn
13 | self.channel = self.connection.channel()
14 |
15 | def get_consumers(self, Consumer, channel):
16 | exchange = Exchange(
17 | name=AMQP_TOPIC,
18 | type='fanout',
19 | channel=self.channel,
20 | durable=True
21 | )
22 | queues = [
23 | Queue(
24 | name='',
25 | exchange=exchange,
26 | routing_key='',
27 | channel=self.channel,
28 | exclusive=True
29 | )
30 | ]
31 | return [
32 | Consumer(queues=queues, accept=[
33 | 'json'], callbacks=[self.on_message])
34 | ]
35 |
36 | def on_message(self, body, message):
37 | try:
38 | print(body)
39 | except Exception as e:
40 | print(str(e))
41 | message.ack()
42 |
43 |
44 | if __name__ == '__main__':
45 | from kombu.utils.debug import setup_logging
46 | setup_logging(loglevel='DEBUG', loggers=[''])
47 | with Connection(AMQP_URL) as conn:
48 | consumer = FanoutConsumer(conn)
49 | consumer.run()
50 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/pre-commit/mirrors-autopep8
3 | rev: v1.5.1
4 | hooks:
5 | - id: autopep8
6 | - repo: https://github.com/pre-commit/pre-commit-hooks.git
7 | rev: v2.5.0
8 | hooks:
9 | - id: check-added-large-files
10 | - id: check-ast
11 | - id: check-byte-order-marker
12 | - id: check-case-conflict
13 | - id: check-docstring-first
14 | - id: check-json
15 | - id: check-merge-conflict
16 | - id: check-yaml
17 | - id: debug-statements
18 | - id: double-quote-string-fixer
19 | - id: end-of-file-fixer
20 | - id: fix-encoding-pragma
21 | args: ['--remove']
22 | - id: pretty-format-json
23 | args: ['--autofix']
24 | - id: name-tests-test
25 | args: ['--django']
26 | exclude: ^tests/helpers/
27 | - id: requirements-txt-fixer
28 | - id: trailing-whitespace
29 | - repo: https://github.com/pycqa/flake8
30 | rev: 3.9.2
31 | hooks:
32 | - id: flake8
33 | args: ['--config=setup.cfg', '--ignore=E501']
34 | - repo: https://github.com/asottile/pyupgrade
35 | rev: v1.27.0
36 | hooks:
37 | - id: pyupgrade
38 | args: ['--py3-plus']
39 | - repo: https://github.com/asottile/seed-isort-config
40 | rev: v1.9.4
41 | hooks:
42 | - id: seed-isort-config
43 | - repo: https://github.com/pre-commit/mirrors-isort
44 | rev: v4.3.21
45 | hooks:
46 | - id: isort
47 |
--------------------------------------------------------------------------------
/plugins/logstash/README.md:
--------------------------------------------------------------------------------
1 | Logstash Plugin
2 | ===============
3 |
4 | Log alerts to Kibana using Logstash.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/logstash
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `logstash` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 |
30 | ```python
31 | PLUGINS = ['logstash']
32 | ```
33 |
34 | **Default Configuration**
35 |
36 | ```python
37 | LOGSTASH_HOST = 'localhost'
38 | LOGSTASH_PORT = 6379
39 | ```
40 |
41 | **Example**
42 |
43 | ```python
44 | PLUGINS = ['logstash', 'reject']
45 | LOGSTASH_HOST = 'logger.example.com'
46 | ```
47 |
48 | References
49 | ----------
50 |
51 | * Logstash: https://www.elastic.co/products/logstash
52 | * Kibana: https://www.elastic.co/products/kibana
53 |
54 | License
55 | -------
56 |
57 | Copyright (c) 2016 Nick Satterly. Available under the MIT License.
58 |
--------------------------------------------------------------------------------
/plugins/dingtalk/alerta_ding.py:
--------------------------------------------------------------------------------
1 | import logging
2 | import os
3 |
4 | from alerta.plugins import PluginBase
5 | from dingtalkchatbot.chatbot import DingtalkChatbot
6 |
7 | try:
8 | from alerta.plugins import app # alerta >= 5.0
9 | except ImportError:
10 | from alerta.app import app # alerta < 5.0
11 |
12 |
13 | LOG = logging.getLogger('alerta.plugins.ding')
14 |
15 |
16 | DING_WEBHOOK_URL = os.environ.get(
17 | 'DING_WEBHOOK_URL') or app.config.get('DING_WEBHOOK_URL')
18 | DASHBOARD_URL = os.environ.get(
19 | 'DASHBOARD_URL') or app.config.get('DASHBOARD_URL', '')
20 |
21 |
22 | class ServiceIntegration(PluginBase):
23 |
24 | def __init__(self, name=None):
25 |
26 | super().__init__(name)
27 |
28 | def pre_receive(self, alert):
29 | return alert
30 |
31 | def _prepare_payload(self, alert):
32 | return '{}** **{}**\n`{}` ```{}```'.format(
33 | alert.severity,
34 | alert.environment,
35 | alert.event,
36 | alert.value,
37 | )
38 | LOG.debug('DingTalk: %s', alert)
39 |
40 | def post_receive(self, alert):
41 | if alert.repeat:
42 | return
43 |
44 | ding = DingtalkChatbot(DING_WEBHOOK_URL)
45 | message = self._prepare_payload(alert)
46 | LOG.debug('DingTalk: %s', message)
47 | ding.send_text(msg='Received Alert {}'.format(message))
48 | # xiaoding.send_text(msg='next alert {}'.format(service_name_str))
49 |
50 | def status_change(self, alert, status, text):
51 | return
52 |
--------------------------------------------------------------------------------
/plugins/sns/README.md:
--------------------------------------------------------------------------------
1 | AWS SNS Plugin
2 | ==============
3 |
4 | Send alerts to AWS SNS topic.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/sns
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `sns` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 |
30 | ```python
31 | PLUGINS = ['sns']
32 | AWS_ACCESS_KEY_ID = '' # default="not set"
33 | AWS_SECRET_ACCESS_KEY = '' # default="not set"
34 | ```
35 |
36 | **Default Configuration**
37 |
38 | ```python
39 | AWS_REGION = 'eu-west-1"' # default="eu-west-1"
40 | AWS_SNS_TOPIC = 'notify'
41 | ```
42 |
43 | Troubleshooting
44 | ---------------
45 |
46 | Restart Alerta API and confirm that the plugin has been loaded and enabled.
47 |
48 | References
49 | ----------
50 |
51 | * Amazon Web Services SNS: https://aws.amazon.com/sns/getting-started/
52 |
53 | License
54 | -------
55 |
56 | Copyright (c) 2016 Nick Satterly. Available under the MIT License.
57 |
--------------------------------------------------------------------------------
/plugins/cachet/README.md:
--------------------------------------------------------------------------------
1 | Cachet Plugin
2 | =============
3 |
4 | Send incidents to Cachet status page.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/cachet
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `cachet` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 |
30 | ```python
31 | PLUGINS = ['cachet']
32 | CACHET_API_URL = '' # default="not set"
33 | CACHET_API_TOKEN = '' # default="not set"
34 | CACHET_SSL_VERIFY = False
35 | ```
36 |
37 | Troubleshooting
38 | ---------------
39 |
40 | Restart Alerta API and confirm that the plugin has been loaded and enabled.
41 |
42 | Set `DEBUG=True` in the `alertad.conf` configuration file and look for log
43 | entries similar to below:
44 |
45 | References
46 | ----------
47 |
48 | * Cachet status page docs: https://docs.cachethq.io/reference
49 | * Python Cachet Client: https://github.com/dmsimard/python-cachetclient
50 |
51 | License
52 | -------
53 |
54 | Copyright (c) 2016 Nick Satterly. Available under the MIT License.
55 |
--------------------------------------------------------------------------------
/plugins/dingtalk/README.md:
--------------------------------------------------------------------------------
1 | # AlertaPlugins
2 | This repo contains the Dingtalk plugin for Alerta
3 |
4 |
5 | DingTalk Plugin
6 | ================
7 |
8 | Send new alerts to Dingtalk.
9 |
10 |
11 | Installation
12 | ------------
13 |
14 | Clone this GitHub repo and run:
15 |
16 | $ python setup.py install
17 |
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `dingtalk` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 |
30 | SERVICE_KEY_MATCHERS takes an array of dictionary objects, mapping a regular
31 | expression to a Dingtalk webhook token. This allows sending alerts to
32 | multiple Dingtalk service integrations, based on 'alert.resource'.
33 |
34 | ```python
35 | PLUGINS = ['dingtalk']
36 | DING_WEBHOOK_URL = '' # default="not set"
37 | WEBHOOK_MATCHERS = [] # default="not set"
38 | ```
39 |
40 | The `DASHBOARD_URL` setting should be configured to link pushover messages to
41 | the Alerta console:
42 |
43 | ```python
44 | DASHBOARD_URL = '' # default="not set"
45 | ```
46 |
47 | **Example**
48 |
49 | ```python
50 | PLUGINS = ['reject', 'dingtalk']
51 | DING_WEBHOOK_URL = 'https://oapi.dingtalk.com/robot/send?access_token=fc89e66e'
52 | WEBHOOK_MATCHERS = [ {"regex":"proxy[\\d+]", "webhook":"https://oapi.dingtalk.com/robot/send?access_token=f9216e240af"} ]
53 | DASHBOARD_URL = 'https://try.alerta.io'
54 | ```
55 |
--------------------------------------------------------------------------------
/webhooks/statuscake/alerta_statuscake.py:
--------------------------------------------------------------------------------
1 | import hashlib
2 | import os
3 |
4 | from alerta.exceptions import RejectException
5 | from alerta.models.alert import Alert
6 | from alerta.webhooks import WebhookBase
7 |
8 |
9 | class StatusCakeWebhook(WebhookBase):
10 |
11 | def incoming(self, query_string, payload):
12 | alert_severity = os.environ.get(
13 | 'STATUSCAKE_DEFAULT_ALERT_SEVERITY', 'major')
14 |
15 | # If the statuscake username and apikey are provided # noqa: E265
16 | # We can validate that the webhook call is valid
17 | statuscake_username = os.environ.get('STATUSCAKE_USERNAME')
18 | statuscake_apikey = os.environ.get('STATUSCAKE_APIKEY')
19 |
20 | if statuscake_username and statuscake_apikey:
21 | decoded_token = statuscake_username + statuscake_apikey
22 | statuscake_token = hashlib.md5(decoded_token.encode()).hexdigest()
23 | if statuscake_token != payload['Token']:
24 | raise RejectException("Provided Token couldn't be verified")
25 |
26 | if payload['Status'] == 'UP':
27 | severity = 'normal'
28 | else:
29 | severity = alert_severity
30 |
31 | return Alert(
32 | resource=payload['Name'],
33 | event='AppDown',
34 | environment='Production',
35 | severity=severity,
36 | service=['StatusCake'],
37 | group='Application',
38 | value=payload['StatusCode'],
39 | text='%s is down' % payload['URL'],
40 | tags=payload['Tags'].split(','),
41 | origin='statuscake',
42 | raw_data=str(payload)
43 | )
44 |
--------------------------------------------------------------------------------
/webhooks/fail2ban/README.md:
--------------------------------------------------------------------------------
1 | Fail2Ban Webhook
2 | ================
3 |
4 | Receive [Fail2Ban](https://www.fail2ban.org) ban notifications via webhook callbacks.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | ```plain
14 | python setup.py install
15 | ```
16 |
17 | Or, to install remotely from GitHub run:
18 |
19 | ```plain
20 | pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/fail2ban
21 | ```
22 |
23 | **Note:** If Alerta is installed in a python virtual environment then plugins
24 | need to be installed into the same environment for Alerta to dynamically
25 | discover them.
26 |
27 | Configuration
28 | -------------
29 |
30 | ### Alerta
31 |
32 | The custom webhook will be auto-detected and added to the list of available API endpoints.
33 |
34 | ### Fail2Ban
35 |
36 | See [Fail2Ban](../../integrations/fail2ban/README.md)
37 |
38 | Example Request
39 | --------------
40 |
41 | ```plain
42 | curl -sSL -X POST -H 'Content-Type: application/json' -d \
43 | '
44 | {
45 | "hostname": "foo",
46 | "severity": "critical",
47 | "attributes": {
48 | "bannedIp": "1.2.3.4"
49 | },
50 | "environment": "Development",
51 | "resource": "SSHD",
52 | "event": "The IP 1.2.3.4 has just been banned by Fail2Ban after 6 attempts!",
53 | "message": "test"
54 | }
55 | ' \
56 | 'http://localhost:8080/api/webhooks/fail2ban?api-key='
57 | ```
58 |
59 | License
60 | -------
61 |
62 | Copyright (c) 2018 Milos Buncic. Available under the MIT License.
63 |
--------------------------------------------------------------------------------
/plugins/op5/README.md:
--------------------------------------------------------------------------------
1 | OP5 Plugin
2 | =============
3 |
4 | Send acknowledgments to OP5 monitor.
5 |
6 | For help, join [](https://slack.alerta.dev)
7 |
8 | Installation
9 | ------------
10 |
11 | Clone the GitHub repo and run:
12 |
13 | $ python setup.py install
14 |
15 | Or, to install remotely from GitHub run:
16 |
17 | $ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=plugins/op5
18 |
19 | Note: If Alerta is installed in a python virtual environment then plugins
20 | need to be installed into the same environment for Alerta to dynamically
21 | discover them.
22 |
23 | Configuration
24 | -------------
25 |
26 | Add `op5` to the list of enabled `PLUGINS` in `alertad.conf` server
27 | configuration file and set plugin-specific variables either in the
28 | server configuration file or as environment variables.
29 | It is recommended to setup an local OP5 user if Active Directory login is enabled.
30 | https://kb.op5.com/display/DOC/Default
31 |
32 | ```python
33 | PLUGINS = ['op5']
34 | OP5_API_URL = '' # default="not set"
35 | OP5_API_USERNAME = '' # default="not set"
36 | OP5_API_PASSWORD = ''
37 | ```
38 |
39 | Troubleshooting
40 | ---------------
41 |
42 | Restart Alerta API and confirm that the plugin has been loaded and enabled.
43 |
44 | Set `DEBUG=True` in the `alertad.conf` configuration file and look for log
45 | entries similar to below:
46 |
47 | References
48 | ----------
49 |
50 | * OP5 monitor docs: https://kb.op5.com
51 | * Python OP5 Client: https://github.com/klarna/op5lib
52 |
53 | License
54 | -------
55 |
56 | Copyright (c) 2017 Anton Delitsch. Available under the MIT License.
57 |
--------------------------------------------------------------------------------
/integrations/fail2ban/alerta.conf:
--------------------------------------------------------------------------------
1 | #
2 | # Author: Milos Buncic
3 | #
4 | # IMPORTANT
5 | #
6 | # Please set jail.local's permission to 640 because it contains your Alerta API key.
7 | #
8 | # This action depends on curl.
9 | #
10 | # To create Alerta API Key: https://docs.alerta.io/en/latest/api/reference.html#api-keys
11 | #
12 |
13 | [Definition]
14 |
15 | # Option: actionstart
16 | # Notes.: command executed once at the start of Fail2Ban.
17 | # Values: CMD
18 | #
19 | actionstart =
20 |
21 | # Option: actionstop
22 | # Notes.: command executed once at the end of Fail2Ban
23 | # Values: CMD
24 | #
25 | actionstop =
26 |
27 | # Option: actioncheck
28 | # Notes.: command executed once before each actionban command
29 | # Values: CMD
30 | #
31 | actioncheck =
32 |
33 | # Option: actionban
34 | # Notes.: command executed when banning an IP. Take care that the
35 | # command is executed with Fail2Ban user rights.
36 | # Tags: IP address
37 | # number of failures
38 | #