##OpenTSDB Support for Dashing Pull data from OpenTSDB and present in Dashing. Support both graph and number widget. Examples for how to write OpenTSDB Sub Queries can be found at http://opentsdb.net/docs/build/html/api_http/query/index.html
This is the gist for easy installing. For the full project please check: https://github.com/Ulrhol/dashing_opentsdb
##Usage
Install manually by following the instructions below or install from the gist:
dashing install 01ade12ae650a77fc8d5
-
Copy
opentsdb.rb
to thejobs
directory -
Make sure the required gems are installed
gem install 'net/http'
gem install 'json'
gem install 'date'
- Configure the
jobs/opentsdb.rb
to pull the required stats:
OPENTSDB_HOST = 'localhost'
OPENTSDB_PORT = 4242
job_mapping = {
'web-server-load' => 'sum:proc.loadavg.5min{host=web.server.net}',
'other-server-load' => 'sum:proc.loadavg.5min{host=other.server.net}'
}
If you wish to set a different timespan to chart do it in the SCHEDULER
. Use the relative timespan as described in the OpenTSDB docs, <amount><time unit>-ago
. Examples: 1h-ago, 4h-ago, 1m-ago, 1w-ago
# get the current points and value. Timespan is static atm
points, current = q.points "#{statname}", "1h-ago"
- Configure dashboard to use your data.
Add to your dashboard file, for instance
dashboards/sample.erb
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="web-server-load" data-view="Graph" data-title="Web Server Load" data-moreinfo="Last 1h"></div>
</ul>
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="other-server-load" data-view="Graph" data-title="Other Server Load" data-moreinfo="Last 1h"></div>
</ul>