check_mysql_query threshold shows 0 on decreased value range

Pär Segelström par.segelstrom at thunderkick.com
Mon Jan 11 14:01:27 CET 2021


Hello,

I come across this plugin when I wanted to move away from an old perl plugin we use today.
Overall this plugin is very good 😊 But I think I found an issues with thresholds when I want to alert on a decreased value range. It seems to trigger the alert just fine but warning and critical thresholds just display: 0.00000.
If I change to an increased value range the threshold is displayed correctly.
I’m using check_mysql_query v2.2 (monitoring-plugins 2.2) on Ubuntu (downloaded with apt install )

See examples below:
Threshold show 0 if I want to alert when a value drops below x
check_mysql_query -d table1 -H localhost -u test -p test -q "select count(*) from test2;" -w 10: -c 5:
QUERY OK: select count(*) from test2;' returned 23.000000 | result=23.000000;0.000000;0.000000;

check_mysql_query -d table1 -H localhost -u test -p test -q "select count(*) from test2;" -w 40: -c 5:
QUERY WARNING: select count(*) from test2;' returned 23.000000 | result=23.000000;0.000000;0.000000;

check_mysql_query -d table1 -H localhost -u test -p test -q "select count(*) from test2;" -w 60: -c 50:
QUERY CRITICAL: select count(*) from test2;' returned 32.000000 | result=32.000000;0.000000;0.000000;

Thresholds works fine if I want to alert on a value goes above x
check_mysql_query -d table1 -H localhost -u test -p test -q "select count(*) from test2;" -w :100: -c :150
QUERY OK: select count(*) from test2;;' returned 54.000000 | result=54.000000;100.000000;150.000000;

check_mysql_query -d table1 -H localhost -u test -p test -q "select count(*) from test2;" -w :40 -c :20
QUERY CRITICAL: select count(*) from test2;' returned 32.000000 | result=32.000000;40.000000;20.000000;

Are you aware of this issue or do you know if the is it fixed in a later version?  Or maybe I’m doing something wrong?

Kind Regards
Pär Segelström
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20210111/d338255e/attachment.html>


More information about the Help mailing list