RE: Recursive Dependencies

2005-07-13 Thread Ryan Clark








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





Heres 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 Im not
100% sure if that works, Ive never tried using it that way.
Typically the root depend is either DNS resolving or ping if it is just an ip
address.





Heres 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


Re: M4 Processing on config files

2005-07-13 Thread Jim Trocki

On Wed, 13 Jul 2005, Gerardo Arceri wrote:

Hi, I use m4 and mon -M option to make it process the config files with said 
m4, i use it to separate the diferent parts of the monitoring into diferent 
files and using include() to join them into the main config. I usually sent 
alerts to 4 or 5 guys and i need to repeat the alert and upalert statements 
for each one on each monitored service, I'd like to use m4 to put the alert 
configuration on a single file and include() it into each watch, problem is: 
does mon process with m4  just the main config file for macro expansion or it 
will also process the include()d file?


mon has no include. the include is part of m4's processing, so it should
perform macro expansion on all the files that you've included.

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