Package: graphitepager
Graphite is a great tool for recording metrics but it isn’t easy to get paged
when a metric passes a certain threshold.Graphite-Pager is an easy to use alerting tool for Graphite that will send
notification alerts if a metric reaches a warning or critical level.RequirementsPython 2.7+GraphiteRedislibmagicInstallationUsing PIP:From Github:pip install git+git://github.com/seatgeek/graphitepager.git@0.2.11#egg=graphitepagerFrom PyPI:pip install graphitepager==0.2.11RunningAt the moment the easiest way to install Graphite-Pager is with Heroku! See
the example athttps://github.com/philipcristiano/graphite-pager-heroku-example.Set Environment variables:exportGRAPHITE_USER=HTTP-basicusernameexportGRAPHITE_PASS=HTTP-basicpasswordexportGRAPHITE_URL=HTTPS(hopefully)URLtoyourGraphiteinstallationexportPAGERDUTY_KEY=SpecificPagerDutyapplicationkeyexportREDIS_URL=redis://localhost:6379/# REDISTOGO_URL is also supportedSet up alerts in thealerts.ymlfileRungraphite-pager:graphite-pager--configalerts.ymlWhere the filealerts.ymlis in the following format.Environment variables can also be specified in the yaml file at the top level. Simply change the casing of the environment variable to lowercase like so:redis_url:"redis://localhost:6379/"Configuration of AlertsConfiguration of alerts is handled by a YAML file. This can be verified withgraphite-pagerverfify--config=config.ymlIf it’s invalid graphite-pager will likely crash.NotifiersNotifiers are what communicate with your preferred alerting service. Currently
Graphite-Pager supports the following notifiers:HipChatPagerDutyPushBulletSlackPagerDuty requires an application key set in the environment asPAGERDUTY_KEYHipChat requires an application keyHIPCHAT_KEYand the room to notifyHIPCHAT_ROOMSlack requires an slackSLACK_URL.PushBullet requires an application keyPUSHBULLET_KEYand optionally
comma separated list of devices inPUSHBULLET_DEVICESand/or comma
separated list of contacts inPUSHBULLET_CONTACTS.More notifiers are easy to write, file an issue if there is something you would like!Documentation urlAn attribute ofdocs\_ulsin the configuration will add a link to the
documentation of the alert. Currently this is in the format of{docs\_url}/{alertname}#{alertlegend name}Alert FormatAlerts have 4 required arguments and 2 optional arguments.Required arguments:name - Name of thie alert groupwarning - Int for a warning valuecritical - Int for a critical valuetarget - Graphtie metric to check, best if aliasedGraphite Pager understands the values for warning and critical in order to
check < and >. If warning is less than critical, values above either will
trigger an alert. If warning is greater than critical than lower values will
trigger the alert.Example:

    Warning: 1
    Critical: 2

    0 is fine, 3 will be critical

    Warning: 2
    Critical: 1

    0 is critical, 3 is fine.Optional argument:from - The Graphitefromparameter for how long to query for ex.-10mindefault-1min.exclude - A list of targets to include. This must match the full target so it is recommended that you use the Graphite functionalias()to make these readable.Ordering of AlertsAlerts with the same name and target will only be checked once! This is useful
if you want to have a subset of metrics with different check times and/or
values-name:Loadtarget:aliasByNode(servers.worker-*.loadavg01,1)warning:10critical:20-name:Loadtarget:aliasByNode(servers.*.loadavg01,1)warning:5critical:10In the above example, anyworker-*nodes will alert for anything 10 or higher but the catchall
will allow for the remaining metrics to be checked without alerting for
worker nodes above 5