Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Grafana Alert Module

grafana-alerts Collects stats from a grafana server based on information available from the Grafana Dashboards. Then compare those values to an alert table and throws alert emails if the case is needed.

Sites

Installation package: https://pypi.python.org/pypi/grafana_alerts

Project Home: https://github.com/pabloa/grafana-alerts

Issues and bugs: https://github.com/pabloa/grafana-alerts/issues

Installation

sudo pip install grafana-alerts

if you get an error, perhaps it is because the version available is a development version. In this case try with:

sudo pip install --pre grafana-alerts

Configuration

Create a file /etc/grafana_alerts/grafana_alerts.cfg with:

#
# Grafana alerts configuration file.
#

# The URL where grafana server is listening. It must finish with the character '/' (default value: http://localhost:3130)
grafana_url = http://yourgrafanaserver.com/grafana/

# Grafana token with viewer access (default value: empty string)
grafana_token = qwertysDssdsfsfsdfSFsfsfEWrwrwERwrewrwrWeRwRwerWRwERwerWRwerweRwrEWrWErwerWeRwRwrewerr==

# email to use as alert sender (default value: grafana-alert@localhost)
email_from = alert@example.com

# smtp server to use (default value: localhost)
smtp_server = localhost

# smtp server host to use (default value: 25)
# if port is not 25, starts a tls session.
smtp_port = 25

# smtp server username to use if it is needed. Optional. Leave it commented if not used. (default value: no username)
#smtp_username = my_smtp_username

# smtp server password to use if it is needed. Optional. Leave it commented if not used. (default value: no password)
#smtp_password = my_smtp_password

Add a cron task to execute grafana_alerts for example each 3 minutes::

*/3 * * * *     grafana_alerts

Monitoring Dashboards

Dashboards to be monitored for alerts must be marked with the tag “monitored”

In each monitored Dashboard, add a text panel with title ‘alerts’ and a description of your alerts. For example::

50<=x<=100; normal; server@example.com

35<x<50; warning; server-mantainers@example.com

x<=35; critical; server-mantainers@example.com, sysop@example.com

Notes:

  • values depend of the graph in that dashboard.

  • x is mandatory.

Here is an example:

https://drive.google.com/a/ailive.net/file/d/0B1LiPvzYYFN0TTlBRnFlTG5Ya1E/view?pli=1

Changes

Version 1.0.0.dev7:

Version 1.0.0.dev6:

Metadata

Release files for grafana_alerts 1.0.0.dev7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grafana_alerts 1.0.0.dev7
File Size Uploaded Provenance
grafana_alerts-1.0.0.dev7.tar.gz 12.7 kB Without provenance Details

Release files / grafana_alerts-1.0.0.dev7.tar.gz

Download URL grafana_alerts-1.0.0.dev7.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
21641d9e41f26b94eeedd3809dec0bbfe9f11f40fe91c60f2f8eeacc275aa395
BLAKE2b-256 checksum
How to use checksums
f3ae13816f63528c36c733c392cf5285dfaec4a2635200bdab7ae298ecf2cb86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for grafana_alerts 1.0.0.dev7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page