StackAddict StackAddict - 6 months ago 42
MySQL Question

Nagios : Setting alerts based in value returned

I am using the plugin check_mysql_health with great success for monitoring MySQL Server. Now, I have encountered a new customization which involves setting the alerts as per the thresholds.

For eg : If I write the following sql mode in check_mysql_health,

select count(*) from revenue where amount > 100000

I get the result as 10.

Suppose, I want to give an alert based on the value received, such as CRITICAL when result < 10, how am I supposed to configure that ?

Any help regarding this will be amazing. Thanks all.


You can use --critical and --warning

check_mysql_health --mode sql --name select... --critical 10:

And use colon after value for <, without colon for >

  • 10: => alert if < 10

  • 90 => alert if > 90