zeroxten / check_influxdb_query Goto Github PK
View Code? Open in Web Editor NEWPlugin to check a query against InfluxDB
License: MIT License
Plugin to check a query against InfluxDB
License: MIT License
Thanks for writing this tool. We're trying to get it to work now, but encountering an issue.
#1 Can the tool connect to influx and pull a data point? Yes, it can:
➜ check_influxdb ./check_influxdb --port 8086 --database graphite --host ***** --username root --password root --query 'select * from /servers.*****.diskspace.root.byte_percentfree/ limit 1' -w 70 -c 80
Debug output. Use -j to check value...
[
{
"name": “servers.*****.diskspace.root.byte_percentfree",
"tags": null,
"values": [
{
"time": "2015-08-04T23:32:47Z",
"value": 70.84
}
]
}
]
CheckInfluxdbQuery WARNING: Check did not exit! You should call an exit code method.
#2 Can we perform a test against a data point? Yes, we can. But this is failing because we are using “select *” instead of “select x” in our query.
➜ check_influxdb ./check_influxdb --port 8086 --database graphite --host ***** --username root --password root --query 'select * from /servers.*****.diskspace.root.byte_percentfree/ limit 1' -w 70 -c 80 -j '$.test..x'
CheckInfluxdbQuery CRITICAL: Value '0' matched '80' for query 'select * from /servers.*****.diskspace.root.byte_percentfree/ limit 1'
#3 Can we change ‘*’ to ‘x’ in the query and test the data point? Sadly, no.
➜ check_influxdb ./check_influxdb --port 8086 --database graphite --host ***** --username root --password root --query 'select x from /servers.*****.diskspace.root.byte_percentfree/ limit 1' -w 70 -c 80 -j '$.test..x'
Check failed to run: unknown field or tag name in select clause: x, ["/Users/cmann/.rvm/gems/ruby-2.2.0/gems/influxdb-0.2.2/lib/influxdb/client/http.rb:90:in `handle_successful_response'", "/Users/cmann/.rvm/gems/ruby-2.2.0/gems/influxdb-0.2.2/lib/influxdb/client/http.rb:14:in `block in get'", "/Users/cmann/.rvm/gems/ruby-2.2.0/gems/influxdb-0.2.2/lib/influxdb/client/http.rb:52:in `call'", "/Users/cmann/.rvm/gems/ruby-2.2.0/gems/influxdb-0.2.2/lib/influxdb/client/http.rb:52:in `connect_with_retry'", "/Users/cmann/.rvm/gems/ruby-2.2.0/gems/influxdb-0.2.2/lib/influxdb/client/http.rb:11:in `get'", "/Users/cmann/.rvm/gems/ruby-2.2.0/gems/influxdb-0.2.2/lib/influxdb/query/core.rb:15:in `query'", "./check_influxdb:124:in `run'", "/Users/cmann/.rvm/gems/ruby-2.2.0/gems/sensu-plugin-1.2.0/lib/sensu-plugin/cli.rb:56:in `block in <class:CLI>'"]
I’ve been trying this tool from CentOS 6.2, CentOS 7.1, and OSX Yosemite, all with similar results. My targets include a mix of InfluxDB 0.8 as well as 0.9 series. This particular example is against a 0.9 system. Maybe there’s just a query syntax change from 0.8 > 0.9 that is making the tool unhappy?
Any help greatly appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.