I sent this earlier, but I must have sent it from the wrong address
and its sitting in a moderation queue...

-David

---------- Forwarded message ----------
From: David Nolan <[EMAIL PROTECTED]>
Date: Dec 1, 2006 8:27 AM
Subject: Re: Handwritten sms.alert doesn't get executed
To: mon@linux.kernel.org


On 12/1/06, Steven Schubiger <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've been quite trying for a while to get a handwritten SMS executed by mon.
> Everything is fine if I open a terminal and run the script with same
> parameters as defined in mon.cf -- the SMS gets send. When run
> by mon, nothing happens.
>
> Looked through the mailing list archive and found some familiar threads
> which had some interesting remarks:
>
> I checked if
> * permissions are right (same as for all other alerts)
> * the interpreter line was valid (same as for all other alerts)
> * no absolute path specified (same as for most other alerts)
> * perl -c <sms.alert>emits no warnings (same as for all other alerts)
>
> Furthermore, I checked whether the script runs, but obviously it
> doesn't. I've examined the syslog and the output generated
> from mon when called with the debugging flag, but they leave
> me in a rather clueless state.
>
> Thanks in advance,
> Steven
>
>

Steven,

Some suggestions for you:

You said "no absolute path specified", did you mean no non-absolute
paths specified?  i.e. if your script runs a program named foobar from
/usr/local/bin it should be calling it as /usr/local/bin/foobar, not
assuming /usr/local/bin is in $PATH.  (Alternatively you can set $PATH
in your script...)

Try adding some debugging code in your script.  i.e. if its perl add
something like:
open(LOG, ">/tmp/alertlog");
...
print LOG "got to step XXX\n";
...
print LOG "got to step YYY\n";


When testing your alert are you also passing the other options that
Mon sets when calling an alert?  i.e. '-g group -s service -h "list of
hosts here"', etc...  (See the Mon man page for full documentation.)

What user do you run mon as?  Have you tested su'ing to that user and
running the script?

Can you post a copy of your script for us to look at?  (without any
SMS numbers, of course...)

-David

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

Reply via email to