send Graphite output to Slack

Just a quick recipe to send rendered graphs from Graphite to Slack, using your crontab(5) and Incoming Webhooks:

0  5  *  *  * /path/to/ >/dev/null

This will send a message to your webhook’s default channel every day at 5am, and Slack show you a preview of the graph in the channel. For completeness’ sake (!) here’s the contents of `/path/to/`:

PAYLOAD="payload={\"text\": \"<$GRAPH|daily metric graph>\"}"
curl -s --dump-header - -X POST --data-urlencode "$PAYLOAD" \

UPDATE: the initial version had a bug with single quotes which ought to have been double quotes. Thanks to GregTheRules for catching that.

3 thoughts on “send Graphite output to Slack

  1. Hi !

    Your script is a nice idea !

    I found an issue with your shell script : $DATA is not evaluated in the $PAYLOAD because of the double quotes. Escaping them with a backquote do the trick.

    Here is my version :

    PAYLOAD=”payload={\”text\”: \”\”}”


  2. I’m wondering if something has change with Slack, this does send the link but no preview is rendered.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s