I have installed Nagios 4.0 on my Ubuntu 14.0 and i want a plugin to alert me based on daily scheduled MySql queries ..
if the result of ( select count(*) from tableName > 10 )
raise a critical alert or < 10
warning alert this query run every day for example.
is it even possible ?! if so can you tell any suggested plugins , ideas or where to start ..
Best Answer
I do exactly that. The test is pretty trivial, inasmuch as it connects to a custom database called
nagios
and selects from a table that contains just a single numeric value, alerting if that value isn't74581
- but I figure ifmysql
works well enough to retrieve that exact number from a table, it's probably fine. You could run more complex queries, though.This is invoked by NRPE (hence the format of the above, which is from
nrpe.cfg
); thecheck_mysql_query
plugin is a standard nagios plugin, at least in my distro (CentOS 6 with thenagios-plugins
package from RPMForge). It can also be found here (with thanks to the OP for the link).