On Wednesday 20 November 2002 08:12, Philippe Trolliet wrote:
> [...]
> i only want to send alerts of c:c1 if b:b1 and a:a1 are working and no
> alerts if they fail. but that didnīt work.
> i had to remove the dependecy in b:b1, then it worked. the same for d:d1. i
> removed the dependencies in all parent services. the it worked.

sorry for long idle time -- my mon host almost went on fire due to fan failure

well I tried the following:

ls -l dummy*
lrwxrwxrwx    1 root     root           10 Nov 22 09:50 dummy-false.monitor -> 
/bin/false
lrwxrwxrwx    1 root     root            9 Nov 22 09:49 dummy-true.monitor -> 
/bin/true

(_at_work_ and _mail_alert_ are m4 macros)

=== test set 1 ===
watch pippo
        service alpha
                interval 1m
                monitor dummy-true.monitor
                period _at_work_
                        alert _mail_alert_
                        numalerts 1

watch ciccio
        service beta
                interval 1m
                monitor dummy-true.monitor
                depend pippo:alpha
                period _at_work_
                        alert _mail_alert_
                        numalerts 1

watch bingo
        service gamma
                interval 1m
                monitor dummy-false.monitor
                depend ciccio:beta
                period _at_work_
                        alert _mail_alert_
                        numalerts 1
===
this works: I get the alert for ciccio:beta
===

=== test set 2 ===
(same as above for pippo, ciccio and bingo; then ....)
watch bongo
        service delta
                interval 1m
                monitor dummy-false.monitor
                depend pippo:alpha and ciccio:beta
                period _at_work_
                        alert _mail_alert_
                        numalerts 1
===
the I define a monshow view "test" :

set full
watch pippo
watch ciccio
watch bingo
watch bongo
===
 monshow --view test

     server: localhost
       time: Fri Nov 22 10:01:47 2002
      state: scheduler running

  GROUP           SERVICE      STATUS      LAST       NEXT       ALERTS 
SUMMARY
D bingo           gamma        FAIL        19s        41s        1      (NO 
SUMMARY)
D bongo           delta        FAIL        23s        36s        1      (NO 
SUMMARY)
R pippo           alpha        -           3s         57s        none
D ciccio          beta         -           9s         51s        none

so this works too (in fact my mail box is growing...)
===

I also tried a far more complex case, with cross-dependent services (in fact 
this is quite similar to my true mon.m4)
==test set 3===
watch pippo
        service alpha
                interval 1m
                monitor dummy-true.monitor
                period _at_work_
                        alert _mail_alert_
                        numalerts 1

watch ciccio
        service beta
                interval 1m
                monitor dummy-true.monitor
                depend pippo:alpha and bingo:gamma
                dep_behavior a
                period _at_work_
                        alert _mail_alert_
                        numalerts 1

watch bingo
        service gamma
                interval 1m
                monitor dummy-true.monitor
                depend pippo:alpha and ciccio:beta
                dep_behavior a
                period _at_work_
                        alert _mail_alert_
                        numalerts 1

watch bongo
        service delta
                interval 1m
                monitor dummy-true.monitor
                depend ciccio:beta
                dep_behavior a
                period _at_work_
                        alert _mail_alert_
                        numalerts 1

watch gringo
        service epsilon
                interval 1m
                monitor dummy-false.monitor
                depend bingo:gamma and bongo:delta
                dep_behavior a
                period _at_work_
                        alert _mail_alert_
                        numalerts 1
===
(PLEASE NOTE I CHANGED BOTH MONITOR RETURN VALUES AND DEPENDENCIES)
===

monshow --view test

     server: localhost
       time: Fri Nov 22 10:15:17 2002
      state: scheduler running

  GROUP           SERVICE      STATUS      LAST       NEXT       ALERTS 
SUMMARY
D gringo          epsilon      FAIL        5s         53s        none   (NO 
SUMMARY)
R pippo           alpha        -           30s        28s        none
D ciccio          beta         -           41s        19s        none
D bingo           gamma        -           17s        41s        none
D bongo           delta        -           28s        30s        none
===

so you are right... there exist some cases when mon fails to send alerts. 
Still it correctly check and report gringo:epsilon as FAILED.


*** Is there anyone out there wishing to solve this ? ***
***or to explain us what we missed ? ***

Piero
_______________________________________________
mon mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to