Page 1 of 1
check_mysql_query thresholds
Posted: Tue Aug 27, 2013 9:04 am
by eprice-mhp
I'm trying to set a correct critical threshold level for the check_mysql_query plugin. The table will show a 0 when good and 1 or higher when critical.
I can't find a working critical threshold value that will alarm. On my test system when I run the query I correctly get a "1". When I run the query using the plugin I get "1.000000".
This is what I have on the host without the critical threshold:
command[check_mysql_query]=/usr/lib64/nagios/plugins/check_mysql_query -H localhost -u username -p password -d demo -q "query"
Re: check_mysql_query thresholds
Posted: Tue Aug 27, 2013 10:42 am
by slansing
command[check_mysql_query]=/usr/lib64/nagios/plugins/check_mysql_query -H localhost -u username -p password -d demo -q "query"
Where and how are you defining your warning and critical thresholds in this command? Or for use with it "i.e arguments."
Re: check_mysql_query thresholds
Posted: Tue Aug 27, 2013 10:52 am
by eprice-mhp
I tried these:
command[check_mysql_query]=/usr/lib64/nagios/plugins/check_mysql_query -H localhost -u username -p password -d demo -q "query" -w 1:1 -c 1:1
command[check_mysql_query]=/usr/lib64/nagios/plugins/check_mysql_query -H localhost -u username -p password -d demo -q "query" -c 1:9999
But these won't kick off the critical alarm. If I do "-c 2:9999", it will go critical; however the query most of the time will be 0 (good) or 1 (bad).
Re: check_mysql_query thresholds
Posted: Tue Aug 27, 2013 4:00 pm
by sreinhardt
Have you just tried using ~:0? Considering that 1 is bad and 0 is good, doing greater than 0 should match, if 1 go critical.
Code: Select all
/usr/lib64/nagios/plugins/check_mysql_query -H localhost -u username -p password -d demo -q "query" -c ~:0
Re: check_mysql_query thresholds
Posted: Thu Aug 29, 2013 8:57 am
by eprice-mhp
That worked! Thanks so much!
Re: check_mysql_query thresholds
Posted: Thu Aug 29, 2013 9:50 am
by slansing
Excellent!