well, i copied the script to the test.alert file, but there is no log
created in /tmp.
showmon gives 2 fails and 2 alerts..
I changed the owner from root to mon (alert scripts) and chmod 777 on them

Still no luck...
I don't know if could have something to do with ubuntu? (i tried it with
8.04 and 9.10 server) both the same problem!





-------- Original Message --------
Subject: Re: getting mon to execute shell command
Date: Mon, 26 Apr 2010 07:36:24 +0200
From: Beat Jucker <beat.juc...@glue.ch>
To: mon@linux.kernel.org

> > I changed the test.alert script so it reads this:
> > 
> >  #!/usr/bin/sh
> > 
> > echo "servers down test" | gammu --sendsms TEXT 0653638072
> > 
> > But it doesn't work....

To trace your problem I would enhance the monitor script and
check the log. Maybe there is something wrong in MON PATH
(not finding gammu)?

#!/usr/bin/sh

exec 2>> /tmp/smsmonitor.log
echo "MON: $0 $* @ `date`" >&2

echo "servers down test" | gammu --sendsms TEXT 0653638072

> Have you tried running that script yourself?  (Not the contents, but the
> script itself.)
> 
> I don't know of any OS that stores sh in /usr/bin.  My bet is on
> /bin/sh.  :)

wrong assumption - e.g. real unix ;-) like solaris:

$ type sh
sh is a tracked alias for /usr/bin/sh
$ ls -ld /bin /usr/bin
lrwxrwxrwx   1 root     root           9 Apr 28  2004 /bin -> ./usr/bin
drwxr-xr-x   4 root     bin        13824 Jul  7  2008 /usr/bin


Regards
-- Beat

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to