On Thu, Apr 08, 2010 at 10:36:19AM +0200, Thomas Andrews wrote:
> Hi,
> I would like to have mon run myscript.sh and alert me if the script 
> returns a non-zero result. How do I do that?
> Unfortunately, I have no clue about perl, so I don't understand the 
> existing mon scripts. Is there an example that anyone can point me to 
> that uses bash scripts ?

what about following small shell test.monitor script 
(installed in your mondir):



echo "`basename $0`: this is my summary (RC=$RC)"

echo "Script called: $0 $*"
echo "... and now some details ..."
echo "... and some more details ..."
echo "... whatever you like ..."
echo "... this is my exit code: $RC"

exit $RC

This script can be configured like

  watch something
    description my test script
    interval 1m
    monitor test.monitor arg1 arg2
    perid wd {Sun-Sat}
    alert mail.alert y...@some.where
    upalert mail.alert y...@some.where

As usual: RT.M

-- Beat

mon mailing list

Reply via email to