Riemann Postgresql Query
A simple postgresql riemann client based on https://github.com/riemann/riemann-postgresql Runs a query on postgres and emits the result to riemann.
Queries should return a single row of numeric values.
Installation
gem install riemann-postgresql-query
Usage
riemann-postgresql-query --postgresql-database "test" --postgresql-username "admin" --query "SELECT MAX(price), MIN(stock) FROM products LIMIT 1;" --service "products-table"
Will result in the following events:
{:host=>"localhost",
:service=>"pi-pages-table-price",
:metric=>700.0,
:state=>"ok",
:description=>"SELECT MAX(price) as price, MIN(stock) FROM pages;",
:tags=>["postgresql"]}
{:host=>"localhost",
:service=>"pi-pages-table-min",
:metric=>1.0,
:state=>"ok",
:description=>"SELECT MAX(price) as price, MIN(stock) FROM pages;",
:tags=>["postgresql"]}