Alerting Module to use with Grafana metrics.
Project description
Collects stats from a grafana server based in information available in Grafana Dashboards, compare those values to an alert table and throws alert emails in case it is needed.
Sites
Installation package: https://pypi.python.org/pypi/grafana_alerts
Project Home: https://github.com/pabloa/grafana-alerts
Issues amd bugs: https://github.com/pabloa/grafana-alerts/issues
Installation
pip install 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) smtp_port = 25
Mark your grafana boards 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.
Add a cron task to execute grafana_alerts for example each 3 minutes::
*/3 * * * * grafana_alerts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for grafana_alerts-1.0.0.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b88890072c75152d67a4e2ec5ba9b83ea73f8e7306cbc028693dca1f47e1a1e |
|
MD5 | 8417a2905d8d3fe6e3c5319ecf327bb8 |
|
BLAKE2b-256 | 2c4c32494d919e2faf5cc868437304c0ce9962265a9ea9b10f347f6ac77855fd |