[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
monit without start/stop
From: |
Kimo Rosenbaum |
Subject: |
monit without start/stop |
Date: |
Fri, 13 Aug 2010 10:25:11 -0700 (PDT) |
Hello,
Our infrastructure servers run named, tacacs, etc for the rest of the nodes in
the datacenters. The clients connect to anycast'ed IPs rather than the actual
IPs of the servers. This allows for maintenance/failure of a server without
affecting clients. We use openbgpd on the servers to announce (or not) the
anycast IP.
What I've been trying to accomplish is this (psuedo-config):
check process named with pidfile /var/run/named/pid
if running and success localhost 53 dns udp and
success localhost 53 dns tcp then
exec "start anycast IP"
else
exec "stop anycast IP"
But I haven't found the optimal configuration. The caveat is that we don't want
monit to care about starting/stopping the server, it just needs to run the
anycast scripts. This is so our noc doesn't have to have exceptions in their
process - its way easier to do "/etc/rc.d/foo stop" and open a ticket so the
sys
admins can look when they get in than to have if/else flow charts varying by
service.
The config that seems to get me the closest is:
check host localhost with address localhost
if failed host 127.0.0.1 port 53 type udp protocol dns then
exec "stop anycast IP"
else if recovered then
exec "start anycast IP"
if failed host 127.0.0.1 port 53 type tcp protocol dns then
exec "stop anycast IP"
else if recovered then
exec "start anycast IP"
But I get 5 messages every check interval which is too noisy. It also runs the
stop/start script twice since the udp and tcp checks happen at the same time
(not bad, just annoying).
Is there a way to only log on the first failure (resetting on recovery)?
Or is there a better config?
I've also tried this but 'foo' gets started before any of the named tests are
ran:
check process named with pidfile /var/.../
start program = "true"
stop program = "true"
if failed ...
check file foo with path /some/dummy/file
start program = "start anycast IP"
stop program = "stop anycast IP"
depends on named
Thanks for any help/suggestions.
Thanks
Kimo
- monit without start/stop,
Kimo Rosenbaum <=