No Description

David Yurkiewicz c23f580af8 Hiding password from terminal 4 years ago e0f6da8fd6 Adding License file 5 years ago eaead2bd75 Update 5 years ago
jawboneup_to_graphite.rb c23f580af8 Hiding password from terminal 4 years ago


A little script for sending Sleep metrics from your Jawbone Up to Graphite


This script requires a couple of gems to function. Run the following gem install commands before using:

gem install choice
gem install faraday
gem install jawbone-up


Before using the script, you'll need to get a XID and Token from Jawbone to use with the script. To do this, run the script with the --get-token option and enter your Jawbone Up username and password as below. The script will then return an XID and Token.

$> ./jawboneup_to_graphite.rb --get-token
Jawbone Username:
Jawbone Password: mypassword
Token: bhdoijfoijdoipjfdspad
Xid: sdsajdosajdioaj

The next step is to copy your XID and Token into the xid and token variables at the top of the jawboneup_to_graphite.rb script. You'll also want to set your graphite host, port, and the prefix you want to give your metrics:

xid = 'bhdoijfoijdoipjfdspad'
token = 'sdsajdosajdioaj'
graphite_host = "my.graphite.server"
graphite_port = "2003"
metric_prefix = "me.jawbone.sleep"

Now you just need to run the script whenever you Sync your Jawbone Up, and it'll send your sleep metrics to graphite ready for adding to Dashboard, creating Nagios alerts and so on.

Please note, each time it's run, the script will send all sleep data dated since yesterday at midnight to graphite. This avoids sending repeated old data to your graphite server.