Well, you could use a shell script to run "mysqladmin status".

I.e. this bash script:

#! /bin/bash

# mystatus.sh is really just a simple alias for a
# longer command.

# Usage: 'mystatus.sh PASSWORD'

# replace values of $my_hostname and $my_username if needed
my_hostname='localhost'
my_username='root'
my_password="${1}"
export my_hostname my_username my_password

# execute the command
/usr/local/mysql/bin/mysqladmin -h $my_hostname -u $my_username \
     --password=$my_password status

# end of file

I tested this out with variables corresponding to my own system, I'm 
running RH Linux with MySQL 3.23.46.  You don't even have to replace the 
values in the "variables" section of the script with your own, if your 
MySQL server is on the localhost.  The setup as is takes the password 
from STDIN, so it's not stored anywhere (though I don't know how to 
write a script that "hides" the password as you type it [yet]).  I'm 
sure that you could do a better script than this in Perl, which I don't 
yet know.

I'm still learning how to write bash scripts (this is my second one that 
does anything useful) so if this code is amateurish, sorry.

Erik





On Friday, January 4, 2002, at 06:52  AM, Sascha Kettner wrote:

> Hi!
>
> Short question: i want to have a perl watchdog telling me when executed
> if my sql-server is running and if anything is allright with it. So if i
> get any errormessage i can restart the server by remote. Has someone
> done this allready? Any hint?
>
> Thanks again and best regards
>
> Sascha Kettner
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <mysql-unsubscribe-
> [EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to