check_mysql_health
check_mysql_health copied to clipboard
Return Unknown if No Data from SQL Query
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.