Skip to main content

Sending critical errors to syslog, slack, email, {your_plugin}.

Project description

Install:

pip install critbot

Add to “config.py” file:

import critbot.plugins.syslog
import critbot.plugins.slack
import critbot.plugins.email
from critbot import crit_defaults

crit_defaults.subject = 'MyService host:port CRIT'

crit_defaults.plugins = [
    critbot.plugins.syslog.plugin(),
    critbot.plugins.slack.plugin(
        token='Get it from https://my.slack.com/services/new/bot',
        channel='#general', # '@private' or '#channel'
        users='', # '@user1 @user2 @userN'
    ),
    critbot.plugins.email.plugin(
        to='Name1 <user1@example.com>, Name2 <user2@example.com>',
        user='critbot@example.com', # Add more config if not GMail.
        password='pa$$word',
    ),
]

Check other config options and their defaults, e.g. “seconds_per_notification=60” and “spam=False”:

Use “crit” in other files of your project:

from critbot import crit

try:
    1/0
except Exception:
    crit()
    # More processing if needed.

try:
    1/0
except Exception:
    crit(also='test2')

if True:
    crit('test3')

Please fork https://github.com/denis-ryzhkov/critbot and create pull requests with new plugins inside.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

critbot-0.1.4.tar.gz (3.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page