For the dependencies I’ve always setup the dep_behavior switch as well to tell mon what should and how a dependency is understood.

 

 

Here’s a clip from the man page describing how it works.

 

dep_behavior {a|m}

The evaluation of dependency graphs can control the suppression of either alert or monitor invocations.

Alert suppression. If this option is set to "a", then the dependency _expression_ will be evaluated after the monitor for the service exits or after a trap is received. An alert will only be sent if the evaluation succeeds, meaning that none of the nodes in the dependency graph indicate failure.

Monitor suppression. If it is set to "m", then the dependency _expression_ will be evaulated before the monitor for the service is about to run. If the evaulation succeeds, then the monitor will be run. Otherwise, the monitor will not be run and the status of the service will remain the same.

 

For the double dependency I’m not 100% sure if that works, I’ve never tried using it that way.  Typically the root depend is either DNS resolving or ping if it is just an ip address.

 

 

Here’s a typical host:

 

Host A

 Service ping

            Service SNMP

            Service SSH

            Service etc..

 

And all of the services would rely on ping on the host before they would report failures.

 

 

Ryan Clark, MCP
System Administrator
Internet Marketing Center
[EMAIL PROTECTED]
604-730-2833 Ext 234

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Segura
Sent: Tuesday, July 12, 2005 12:50 PM
To: mon@linux.kernel.org
Subject: Recursive Dependencies

 

Hi all, sorry if this has already been covered, but I coulnd't find anything in the list archive indicating that it has...

 

I have two systems that *pretty much* run the same services, except one.  If this service is running on A, it should not be running on B, and if running on B, it should not be running on A.

 

So I set up dependencies as follows:

 

dep_behavior = a

 

Watch A

    service ping

    interval 60s

    monitor ping.monitor

        period...

        alert...

    service snmp

    interval 60s

    monitor snmp.monitor

        depend SELF:ping

        period...

        alert...

    service IMGService

    interval 60s

    monitor ....

        depend SELF:ping && SELF:snmp && ! B:IMGService

 

Watch B

    service ping

    interval 60s

    monitor ping.monitor

        period...

        alert...

    service snmp

    interval 60s

    monitor snmp.monitor

        depend SELF:ping

        period...

        alert...

    service IMGService

    interval 60s

    monitor ....

        depend SELF:ping && SELF:snmp && ! A:IMGService

 

...which seemed like the right thing to do at the time, but I'm getting "dep recursion too deep" message in the logs whenever mon attempts to resolve the dependencies.  Looking at the logs leads me to believe the following is happening:

 

A:ping (OK)

A:snmp (OK)

B:IMGService -> Depends on...

    B:ping (OK)

    B:snmp (OK)

    A:IMGService -> Depends on...

        A:ping (OK)

        A:snmp (OK)

        B:IMGService -> Depends on...

            B:ping (OK)

            B:snmp (OK)

            A:IMGService -> Depends on...

                A:ping(OK)

                A:snmp(OK)

                B:IMGService -> Depends on...

                    B:...

 

etc...etc...

 

So, my question is:  How does one set up dependencies for such a thing?  I'm sure this is going to be one of those "Did you even READ the manual page?" things...it always does when I finally break down and ask for help...but yeah, I did...honest! :)

 

ams

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

Reply via email to