Link to home
Start Free TrialLog in
Avatar of linuxpig
linuxpig

asked on

Nagios mysql script

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!

#!/bin/sh

test=`mysql -P 3306 --socket=/var/mysql/mysql.sock -u mysqlid-pmysqlpw -e 'use mysql_test; show tables;' | wc -l`
echo "OK - $test tables"
ASKER CERTIFIED SOLUTION
Avatar of Umesh
Umesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of linuxpig
linuxpig

ASKER

Quick and accurate answer