{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "Home-page: http://github.com/nfelsen/graphite-beacon\nAuthor: Kirill Klenov\nAuthor-email: horneds@gmail.com\nLicense: MIT\nDescription: graphite-beacon\n ===============\n \n ![logo](https://raw.github.com/klen/graphite-beacon/develop/beacon.png)\n \n Simple alerting system for [Graphite](http://graphite.wikidot.com/) metrics.\n \n Features:\n \n - Simple installation\n - No software dependencies (Databases, AMQP and etc)\n - Light and fully asynchronous\n - SMTP, HipChat, Slack, PagerDuty, HTTP handlers (PRs for additional handlers are welcome!)\n - Easily configurable and supports historical values\n \n [![Build status](http://img.shields.io/travis/klen/graphite-beacon.svg?style=flat-square)](http://travis-ci.org/klen/graphite-beacon)\n [![Coverage](http://img.shields.io/coveralls/klen/graphite-beacon.svg?style=flat-square)](https://coveralls.io/r/klen/graphite-beacon)\n [![Version](http://img.shields.io/pypi/v/graphite-beacon.svg?style=flat-square)](https://pypi.python.org/pypi/graphite_beacon)\n [![License](http://img.shields.io/pypi/l/graphite-beacon.svg?style=flat-square)](https://pypi.python.org/pypi/graphite_beacon)\n [![Downloads](http://img.shields.io/pypi/dm/graphite-beacon.svg?style=flat-square)](https://pypi.python.org/pypi/graphite_beacon)\n \n Example:\n ```js\n {\n \"graphite_url\": \"http://g.server.org\",\n \"smtp\": {\n \"from\": \"beacon@server.org\",\n \"to\": [\"me@gmail.com\"]\n },\n \"alerts\": [\n { \"name\": \"MEM\",\n \"format\": \"bytes\",\n \"query\": \"aliasByNode(sumSeriesWithWildcards(collectd.*.memory.{memory-free,memory-cached}, 3), 1)\",\n \"rules\": [\"critical: < 200MB\", \"warning: < 400MB\", \"warning: < historical / 2\"] },\n { \"name\": \"CPU\",\n \"format\": \"percent\",\n \"query\": \"aliasByNode(sumSeriesWithWildcards(collectd.*.cpu-*.cpu-user, 2), 1)\",\n \"rules\": [\"critical: >= 80%\", \"warning: >= 70%\"] }\n ]}\n ```\n \n Requirements\n ------------\n \n - python (2.7, 3.3, 3.4)\n - tornado\n - funcparserlib\n - pyyaml\n \n \n Installation\n ------------\n \n ### Python package\n \n **graphite-beacon** can be installed using pip:\n \n pip install graphite-beacon\n \n ### Debian package\n \n Using the command line, add the following to your /etc/apt/sources.list system config file:\n \n echo \"deb http://dl.bintray.com/klen/deb /\" | sudo tee -a /etc/apt/sources.list\n echo \"deb-src http://dl.bintray.com/klen/deb /\" | sudo tee -a /etc/apt/sources.list\n \n Install the package using apt-get:\n \n apt-get update\n apt-get install graphite-beacon\n \n ### Ansible role\n \n There is an ansible role to install the package: https://github.com/Stouts/Stouts.graphite-beacon\n \n ## Docker\n \n Build a config.json file and run :\n \n docker run -v /path/to/config.json:/srv/alerting/etc/config.json deliverous/graphite-beacon\n \n \n Usage\n -----\n \n Just run `graphite-beacon`:\n \n $ graphite-beacon\n [I 141025 11:16:23 core:141] Read configuration\n [I 141025 11:16:23 core:55] Memory (10minute): init\n [I 141025 11:16:23 core:166] Loaded with options:\n ...\n \n ### Configuration\n \n ___\n \n Time units:\n \n > '2second', '3.5minute', '4hour', '5.2day', '6week', '7month', '8year'\n \n > short formats are: '2s', '3m', '4.1h' ...\n \n Value units:\n \n > short: '2K', '3Mil', '4Bil', '5Tri'\n \n > bytes: '2KB', '3MB', '4GB'\n \n > bits: '2Kb', '3Mb', '4Gb'\n \n > bps: '2Kbps', '3Mbps', '4Gbps'\n \n > time: '2s', '3m', '4h', '5d'\n \n The default options are:\n \n > Note: comments are not allowed in JSON, but graphite-beacon strips them\n \n ```js\n \n {\n // Graphite server URL\n \"graphite_url\": \"http://localhost\",\n \n // Public graphite server URL\n // Used when notifying handlers, defaults to graphite_url\n \"public_graphite_url\": null,\n \n // HTTP AUTH username\n \"auth_username\": null,\n \n // HTTP AUTH password\n \"auth_password\": null,\n \n // Path to a pidfile\n \"pidfile\": null,\n \n // Default values format (none, bytes, s, ms, short)\n // Can be redefined for each alert.\n \"format\": \"short\",\n \n // Default query interval\n // Can be redefined for each alert.\n \"interval\": \"10minute\",\n \n // Default time window for Graphite queries\n // Defaults to query interval, can be redefined for each alert.\n \"time_window\": \"10minute\",\n \n // Notification repeat interval\n // If an alert is failed, its notification will be repeated with the interval below\n \"repeat_interval\": \"2hour\",\n \n // Default end time for Graphite queries\n // Defaults to the current time, can be redefined for each alert.\n \"until\": \"0second\",\n \n // Default loglevel\n \"logging\": \"info\",\n \n // Default method (average, last_value, sum, minimum, maximum).\n // Can be redefined for each alert.\n \"method\": \"average\",\n \n // Default alert to send when no data received (normal = no alert)\n // Can be redefined for each alert\n \"no_data\": \"critical\",\n \n // Default alert to send when loading failed (timeout, server error, etc)\n // (normal = no alert)\n // Can be redefined for each alert\n \"loading_error\": \"critical\"\n \n // Default prefix (used for notifications)\n \"prefix\": \"[BEACON]\",\n \n // Default handlers (log, smtp, hipchat, http, slack, pagerduty)\n \"critical_handlers\": [\"log\", \"smtp\"],\n \"warning_handlers\": [\"log\", \"smtp\"],\n \"normal_handlers\": [\"log\", \"smtp\"],\n \n // Send initial values (Send current values when reactor starts)\n \"send_initial\": true,\n \n // used together to ignore the missing value\n \"default_nan_value\": -1,\n \"ignore_nan\": false,\n \n // Default alerts (see configuration below)\n \"alerts\": [],\n \n // Path to other configuration files to include\n \"include\": []\n }\n ```\n \n You can setup options with a configuration file. See examples for\n [JSON](examples/example-config.json) and\n [YAML](examples/example-config.yml).\n \n A `config.json` file in the same directory that you run `graphite-beacon`\n from will be used automatically.\n \n #### Setup alerts\n \n Currently two types of alerts are supported:\n - Graphite alert (default) - check graphite metrics\n - URL alert - load http and check status\n \n > Note: comments are not allowed in JSON, but graphite-beacon strips them\n \n ```js\n \n \"alerts\": [\n {\n // (required) Alert name\n \"name\": \"Memory\",\n \n // (required) Alert query\n \"query\": \"*.memory.memory-free\",\n \n // (optional) Alert type (graphite, url)\n \"source\": \"graphite\",\n \n // (optional) Default values format (none, bytes, s, ms, short)\n \"format\": \"bytes\",\n \n // (optional) Alert method (average, last_value, sum, minimum, maximum)\n \"method\": \"average\",\n \n // (optional) Alert interval [eg. 15second, 30minute, 2hour, 1day, 3month, 1year]\n \"interval\": \"1minute\",\n \n // (optional) What kind of alert to send when no data received (normal = no alert)\n \"no_data\": \"warning\",\n \n // (optional) Alert interval end time (see \"Alert interval\" for examples)\n \"until\": \"5second\",\n \n // (required) Alert rules\n // Rule format: \"{level}: {operator} {value}\"\n // Level one of [critical, warning, normal]\n // Operator one of [>, <, >=, <=, ==, !=]\n // Value (absolute value: 3000000 or short form like 3MB/12minute)\n // Multiple conditions can be separated by AND or OR conditions\n \"rules\": [ \"critical: < 200MB\", \"warning: < 300MB\" ]\n }\n ]\n ```\n \n ##### Historical values\n \n graphite-beacon supports \"historical\" values for a rule.\n For example you may want to get warning when CPU usage is greater than 150% of normal usage:\n \n \"warning: > historical * 1.5\"\n \n Or memory is less than half the usual value:\n \n \"warning: < historical / 2\"\n \n \n Historical values for each query are kept. A historical value\n represents the average of all values in history. Rules using a historical value will\n only work after enough values have been collected (see `history_size`).\n \n History values are kept for 1 day by default. You can change this with the `history_size`\n option.\n \n See the below example for how to send a warning when today's new user count is\n less than 80% of the last 10 day average:\n \n ```js\n alerts: [\n {\n \"name\": \"Registrations\",\n // Run once per day\n \"interval\": \"1day\",\n \"query\": \"Your graphite query here\",\n // Get average for last 10 days\n \"history_size\": \"10day\",\n \"rules\": [\n // Warning if today's new user less than 80% of average for 10 days\n \"warning: < historical * 0.8\",\n // Critical if today's new user less than 50% of average for 10 days\n \"critical: < historical * 0.5\"\n ]\n }\n ],\n ```\n \n ### Handlers\n \n Handlers allow for notifying an external service or process of an alert firing.\n \n #### Email Handler\n \n Sends an email (enabled by default).\n \n ```js\n {\n // SMTP default options\n \"smtp\": {\n \"from\": \"beacon@graphite\",\n \"to\": [], // List of email addresses to send to\n \"host\": \"localhost\", // SMTP host\n \"port\": 25, // SMTP port\n \"username\": null, // SMTP user (optional)\n \"password\": null, // SMTP password (optional)\n \"use_tls\": false, // Use TLS?\n \"html\": true, // Send HTML emails?\n \n // Graphite link for emails (By default is equal to main graphite_url)\n \"graphite_url\": null\n }\n }\n ```\n \n #### HipChat Handler\n \n Sends a message to a HipChat room.\n \n ```js\n {\n \"hipchat\": {\n // (optional) Custom HipChat URL\n \"url\": 'https://api.custom.hipchat.my',\n \n \"room\": \"myroom\",\n \"key\": \"mykey\"\n }\n }\n ```\n \n #### Webhook Handler (HTTP)\n \n Triggers a webhook.\n \n ```js\n {\n \"http\": {\n \"url\": \"http://myhook.com\",\n \"params\": {}, // (optional) Additional query(data) params\n \"method\": \"GET\" // (optional) HTTP method\n }\n }\n ```\n \n #### Slack Handler\n \n Sends a message to a user or channel on Slack.\n \n ```js\n {\n \"slack\": {\n \"webhook\": \"https://hooks.slack.com/services/...\",\n \"channel\": \"#general\", // #channel or @user (optional)\n \"username\": \"graphite-beacon\",\n }\n }\n ```\n \n #### Command Line Handler\n \n Runs a command.\n \n ```js\n {\n \"cli\": {\n // Command to run (required)\n // Several variables that will be substituted by values are allowed:\n // ${level} -- alert level\n // ${name} -- alert name\n // ${value} -- current metrics value\n // ${limit_value} -- metrics limit value\n \"command\": \"./myscript ${level} ${name} ${value} ...\",\n \n // Whitelist of alerts that will trigger this handler (optional)\n // All alerts will trigger this handler if absent.\n \"alerts_whitelist\": [\"...\"]\n }\n }\n ```\n \n #### PagerDuty Handler\n \n Triggers a PagerDuty incident.\n \n ```js\n {\n \"pagerduty\": {\n \"subdomain\": \"yoursubdomain\",\n \"apitoken\": \"apitoken\",\n \"service_key\": \"servicekey\",\n }\n }\n ```\n \n #### Telegram Handler\n \n Sends a Telegram message.\n \n ```js\n {\n \"telegram\": {\n \"token\": \"telegram bot token\",\n \"bot_ident\": \"token you choose to activate bot in a group\"\n \"chatfile\": \"path to file where chat ids are saved, optional field\"\n }\n }\n ```\n \n ### Command Line Usage\n \n ```\n $ graphite-beacon --help\n Usage: graphite-beacon [OPTIONS]\n \n Options:\n \n --config Path to an configuration file (JSON/YAML)\n (default config.json)\n --graphite_url Graphite URL (default http://localhost)\n --help show this help information\n --pidfile Set pid file\n \n --log_file_max_size max size of log files before rollover\n (default 100000000)\n --log_file_num_backups number of log files to keep (default 10)\n --log_file_prefix=PATH Path prefix for log files. Note that if you\n are running multiple tornado processes,\n log_file_prefix must be different for each\n of them (e.g. include the port number)\n --log_to_stderr Send log output to stderr (colorized if\n possible). By default use stderr if\n --log_file_prefix is not set and no other\n logging is configured.\n --logging=debug|info|warning|error|none\n Set the Python log level. If 'none', tornado\n won't touch the logging configuration.\n (default info)\n ```\n \n Bug tracker\n -----------\n \n If you have any suggestions, bug reports or annoyances please report them to\n the issue tracker at https://github.com/klen/graphite-beacon/issues\n \n Contributors\n -------------\n \n * Andrej Kuro\u010denko (https://github.com/kurochenko)\n * Cody Soyland (https://github.com/codysoyland)\n * Garrett Heel (https://github.com/GarrettHeel)\n * George Ionita (https://github.com/georgeionita)\n * James Yuzawa (https://github.com/yuzawa-san)\n * Kirill Klenov (https://github.com/klen)\n * Konstantin Bakulin (https://github.com/kbakulin)\n * Lammert Hellinga (https://github.com/Kogelvis)\n * Miguel Moll (https://github.com/MiguelMoll)\n * Nick Pillitteri (https://github.com/56quarters)\n * Niku Toivola (https://github.com/nikut)\n * Olli-Pekka Puolitaival (https://github.com/OPpuolitaival)\n * Phillip Hagedorn (https://github.com/phagedorn)\n * Raine Virta (https://github.com/raine)\n * Scott Nonnenberg (https://github.com/scottnonnenberg)\n * Sean Johnson (https://github.com/pirogoeth)\n * Terry Peng (https://github.com/tpeng)\n * Thomas Clavier (https://github.com/tclavier)\n * Yuriy Ilyin (https://github.com/YuriyIlyin)\n * dugeem (https://github.com/dugeem)\n * Joakim (https://github.com/VibyJocke)\n \n License\n --------\n \n Licensed under a [MIT license](http://www.linfo.org/mitlicense.html)\n \n If you wish to express your appreciation for the role, you are welcome to send\n a postcard to:\n \n Kirill Klenov\n pos. Severny 8-3\n MO, Istra, 143500\n Russia\n \nKeywords: graphite,alerts,monitoring,system\nPlatform: Any\nClassifier: Development Status :: 4 - Beta\nClassifier: Intended Audience :: Developers\nClassifier: License :: OSI Approved :: MIT License\nClassifier: Natural Language :: English\nClassifier: Natural Language :: Russian\nClassifier: Operating System :: OS Independent\nClassifier: Programming Language :: Python :: 2\nClassifier: Programming Language :: Python :: 3\nClassifier: Programming Language :: Python\nClassifier: Topic :: Software Development :: Libraries :: Python Modules\nClassifier: Topic :: Software Development :: Testing\nClassifier: Topic :: Utilities\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "graphite-beacon-opsgenie-v2", "package_url": "https://pypi.org/project/graphite-beacon-opsgenie-v2/", "platform": "", "project_url": "https://pypi.org/project/graphite-beacon-opsgenie-v2/", "project_urls": null, "release_url": "https://pypi.org/project/graphite-beacon-opsgenie-v2/0.27.3/", "requires_dist": null, "requires_python": "", "summary": "Simple alerting system for Graphite metrics.", "version": "0.27.3" }, "last_serial": 4110892, "releases": { "0.27.3": [ { "comment_text": "", "digests": { "md5": "d2f93bc3a3f6f51a30e982287bad98ce", "sha256": "07633ee1a3956a132329868469ecc90abd7c2d03100fab600d9c981587d3e074" }, "downloads": -1, "filename": "graphite_beacon_opsgenie_v2-0.27.3.tar.gz", "has_sig": false, "md5_digest": "d2f93bc3a3f6f51a30e982287bad98ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27567, "upload_time": "2018-07-28T03:44:07", "url": "https://files.pythonhosted.org/packages/6b/7b/9bba3f8890d0eb41cc02a6221b01ba058a908eca3a8d6bc58e76986c3b00/graphite_beacon_opsgenie_v2-0.27.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d2f93bc3a3f6f51a30e982287bad98ce", "sha256": "07633ee1a3956a132329868469ecc90abd7c2d03100fab600d9c981587d3e074" }, "downloads": -1, "filename": "graphite_beacon_opsgenie_v2-0.27.3.tar.gz", "has_sig": false, "md5_digest": "d2f93bc3a3f6f51a30e982287bad98ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27567, "upload_time": "2018-07-28T03:44:07", "url": "https://files.pythonhosted.org/packages/6b/7b/9bba3f8890d0eb41cc02a6221b01ba058a908eca3a8d6bc58e76986c3b00/graphite_beacon_opsgenie_v2-0.27.3.tar.gz" } ] }