On Fri, 1 Dec 2006 14:12:55 +0100
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.

I feel your pain  , have you checked for empty lines near your 
service definitions ?

e.g.  

hostname foobar 10.0.0.2

watch foobar
        service wibble_ok
        service wibble_also_ok

        service wibble_will_be_ignored

hostname foobaz 10.0.0.3

watch foobar

        service wibble_will_also be_ignored
        service none_of_the_others_will_run_despite_being_ok

This one bites my ass regularly especially with m4 generated configs.

I'm looking at solving this problem in general and i think it can be done
by piping the config file through sed which could run a regex to filter 
newlines around services.  That said i am wary of adding more post-processing
to my config files and would like to fix it in the mon source .

I'm happy to produce a patch to solve this if people feed me the necessary 
tuits.

Anyone else implemented this or similar ?

Toodle-pip
Amias

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

Reply via email to