sensu/sensu-community-plugins — pull request #349 by jblackburn22 (2013-11-14 19:10:14+00:00)
Title: Add opentsdb check to generate an alert for data stored in opentsdb

This check is similar to graphite/check_data.rb. It has two modes of operation. It compares an OpenTSDB metric or the ratio of 2 metrics against a threshold. By default, the comparison is greater than but it can be altered via a command line argument. Some usage examples are

$ bundle exec ./check_opentsdb_series.rb --host opentsdb-1003.va.opower.it --metric mysql.general.preparedStmtCount,mysql.configuration.MaxPreparedStmtCount --tags host=dbpr001.va.opower.it --ratio_threshold .80 --comparator lt
CheckOpenTSDBSeries OK: Check OK (< 0.8) for mysql.general.preparedStmtCount/mysql.configuration.MaxPreparedStmtCount

$ bundle exec ./check_opentsdb_series.rb --host opentsdb-1003.va.opower.it --metric mysql.general.preparedStmtCount --tags host=dbpr001.va.opower.it --threshold 10000
CheckOpenTSDBSeries CRITICAL: Check failed (> 10000.0) for metric mysql.general.preparedStmtCount with tags host=dbpr001.va.opower.it

Also included are some rspec tests for the check.