I have a small script that runs on a server that has mysql, then nrpe returns the output to the nagios server. I want to change this so that the nagios server runs the script by logging into the mysql db on the remote machine. Im not that good with mysql so maybe someone can look at my mysql script and tell me how to change it to loging and do its check remotely. Thanks!
test=`mysql -P 3306 --socket=/var/mysql/mysql.sock -u mysqlid-pmysqlpw -e 'use mysql_test; show tables;' | wc -l`
echo "OK - $test tables"