Skip to content

Instantly share code, notes, and snippets.

@dwdraju
Last active June 23, 2018 08:53
Show Gist options
  • Save dwdraju/8ec754b768aa31f93e68f849208e733a to your computer and use it in GitHub Desktop.
Save dwdraju/8ec754b768aa31f93e68f849208e733a to your computer and use it in GitHub Desktop.
hubot-slack grafana screenshot
npm install -g yo generator-hubot
mkdir myhubot
cd myhubot
yo hubot
bin/hubot
Hubot>
bin/hubot --name myhubot
myhubot>
npm install hubot-grafana --save
  • Add hubot-grafana to external-scripts.json:
[
  "hubot-grafana"
]
  • Set environment variables
export HUBOT_GRAFANA_HOST=http://[grafan-url]
export HUBOT_GRAFANA_API_KEY="eyJrIjoiZ1BVUdsfsdfdsfdsfsdfjHKJDHFJHDJHFJDFDFDZCI6MX0=example"
export HUBOT_GRAFANA_QUERY_TIME_RANGE=5m
export HUBOT_SLACK_TOKEN="xKJFdsfas-92-4TFysvV1H3Dtbu3GN2Yf8K9hexample"
export HUBOT_ADAPTER=slack

Receive screenshot of grafana

hubot graf list
hubot graf list production
hubot graf db graphite-carbon-metrics
hubot graf db graphite-carbon-metrics:3
hubot graf db graphite-carbon-metrics:cpu
hubot graf db graphite-carbon-metrics:panel-8
hubot graf db graphite-carbon-metrics now-12hr
hubot graf db graphite-carbon-metrics now-24hr now-12hr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment