check_mysql_health icon indicating copy to clipboard operation
check_mysql_health copied to clipboard

Return Unknown if No Data from SQL Query

Open trevrobwhite opened this issue 7 years ago • 0 comments

Hi, We are running check_mysql_health in mode=sql --mode=sql --name="Select data from database where a=b ORDER BY timestamp DESC LIMIT 1" --name2="data" --units=s --warning=6 --critical=10

However if no data is returned we get:

Use of uninitialized value $value in numeric gt (>) at /opt/openitc/nagios/libexec/check_mysql_health line 1242. Use of uninitialized value $value in numeric gt (>) at /opt/openitc/nagios/libexec/check_mysql_health line 1243. OK - data: s

Is there a way the plugin can return UNKNOWN if no data is returned by the query, rather than OK?

Many thanks.

trevrobwhite avatar Sep 01 '17 08:09 trevrobwhite