DevOpsmonitoring tool

How to Setup Alerting System for Graphite Metrics

In this tutorial, you will learn how to setup alerting system for Graphite metrics. Graphite is a monitoring tool that runs on the local system or Cloud infrastructure.

Graphite is used to monitor the performance of any services/application/website/network. Graphite is the new generation of monitoring tools which makes easier than to store/retrieve/share and visualize the date.

Referred from Klen/graphite-beacon

The feature of Graphite-beacon:

  • It is very simple and easy to install
  • No other software dependency like database
  • It is asynchronous
  • Support alerting on SMTP, HipCHat, Slack, PagerDuty, HTTP handlers
  • Easy to configure with historical values

Pre-requisites:

  • Python (2.7, 3.3, 3.4)
  • tornado
  • funcparserlib
  • pyyaml

Steps to install graphite-beacon using pip command

Debian package

Add the following to your /etc/apt/sources.list system config file:

Install the graphite-beacon package using apt-get:

You can setup options with a configuration file.

Keep the config.json file in the same directory where you run graphite-beacon command.

JSON example:

How to Setup Alerts in Graphite:

Currently, it supports two types of alerts:

  1. Graphite alert (default) – check graphite metrics
  2. URL alert – load HTTP and check status

Historical Values

graphite-beacon supports “historical” values for a rule.

For example: Assume you want to get a warning when CPU usage is greater than 150% of normal usage then you can set as followed.

For memory alerts less than half value

Historical values for each query are kept. A historical value represents the average of all values in history.

Note:

  1. Rules using a historical value will only work after enough values have been collected (see history_size).
  2. History values are kept for 1 day by default. You can change this with the history_size

See the below example for how to send a warning when today’s new user count is less than 80% of the last 10-day average:

Handlers in Graphite-beacon:

Handlers allow for notifying an external service or process of an alert firing.

Email Handler

Sends an email (enabled by default).

HipChat Handler

Sends a message to a HipChat room.

Webhook Handler (HTTP)

Triggers a webhook.

Slack Handler

Sends a message to a user or channel on Slack.

Command Line Handler

Runs a command.

PagerDuty Handler

Triggers a PagerDuty incident.

Command Line Usage

This tutorial covers how to Setup Alerting System for Graphite Metrics.

Related Articles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker
%d bloggers like this: