I'm trying to check mysql queries output and compare the result with some values for my Nagios services checks.
It can be that there is a better way to resolve this (and if so - please share :))...
For now, I'm trying this method:
./check_mysql_health --username root --password MyPassw0rd --mode sql --name 'show variables like 'max_connections'' --name2 "max_connections 4096"
PS: my max_connections is 4096
mysql -Bse "show variables like 'max_connections';"
max_connections 4096
The output is:
Use of uninitialized value $value in numeric gt (>) at ./check_mysql_health line 1237.
Use of uninitialized value $value in numeric gt (>) at ./check_mysql_health line 1238.
OK - max_connections 4096:
And if I change the value in name2 to something not equal to "max_connections 4096", like "G1Li" the output returns with OK status.
./check_mysql_health --username root --password MyPassw0rd --mode sql --name 'show variables like 'max_connections'' --name2 "G1Li"
Use of uninitialized value $value in numeric gt (>) at ./check_mysql_health
line 1237.
Use of uninitialized value $value in numeric gt (>) at ./check_mysql_health line 1238.
OK - g1li:
# echo $?
0
Any ideas?
Gili