Hello,

you can use the "check program" to test the exit value of custom script. In 
this case the script can execute the SQL statement and return error if problem 
is found.

Script skeleton:
--8<--
#!/bin/bash
/ur/bin/mysql -e "SQL STATEMENT" ... | PROCESS OUTPUT AND RETURN 1 IF FAILED 
OTHERWISE 0
--8<--

Connection of the script with monit:
--8<--
 check program myscript with path "/usr/local/bin/myscript.sh"
       if status != 0 then alert
--8<--

Regards,
Martin


On Sep 9, 2012, at 4:58 PM, Charles Pino <[email protected]> wrote:

> Hello all,
>  is it possible to execute and SQL query and have monit execute and alert or 
> something else depending on its response?
> 
>  i have a sql query that queries a specific table. of something hasnt been 
> updated in that table for 12 hours. i need to send an alert or whatever. that 
> the table/field hasnt been updated.
> 
> please help.
> 
> thanks
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to