Mysql – Nagios thesql check service definition configuration

monitoringMySQLnagiosnetwork-monitoring

I'm using the Consol Labs MySQL Health Check plugin to monitor my MySQL database.

I'd like to change the warning and critical thresholds for the threads connected parameter, but have forgotten how.

My check is setup in my service.cfg like so:

define service {
        use                             mysql-service
        hostgroup_name                  mysql-servers
        check_interval                  1
        service_description             MySQL Threads Connected
        _mysql_mode                     threads-connected
        check_command                   check_mysql_health
}

I'm having trouble remembering in which part of the above config I define my thresholds?

I've tried, check_mysql_health:20:40 & check_mysql_health! -w 20: -c 40:
but they both didn't work.

Anyone know how i do this?

Best Answer

You're missing a fundamental concept here. Read the Macros and how they work docs page.

Roughly: create a new service definition with a command_line like /path/to/your/plugins/check_mysql_health --warning $ARG1$ --critical $ARG2$. (Note that these are standard Nagios threshhold ranges.)

Also be sure to read check_mysql_health --help or see the Consol Labs site for more information about using the plugin.