Martin Pala <address@hidden> writes:
check process apache with pidfile /var/run/httpd.pid
start program = "/etc/init.d/apache start" stop program =
"/etc/init.d/apache stop"
if failed port 80 protocol http then restart
alert address@hidden
depends on mysql
check host mysql on address 10.1.1.1
if failed port 3306 then stop
alert address@hidden
check process mmp with pidfile /var/run/mmp.pid
start program = "/etc/init.d/mmp start" stop program =
"/etc/init.d/mmp stop"
if failed port 110 protocol pop then restart
alert address@hidden
depends on pop-backend1
depends on pop-backend2
check host pop-backend1 on address 10.1.1.1
if failed port 110 then stop
alert address@hidden
check host pop-backend2 on address 10.1.1.2
if failed port 110 then stop
alert address@hidden
As you can see, host 10.1.1.1 provides pop3 as well as mysql, first
syntax is more general and allows such setups.
Good point, with my proposal you can only have *one* check-host entry
in the control file per hostname/address. And the above example will
not work with this proposal. But on the other hand, I could argue that
you can roll-up the above entries into the process entry like so :-)
check process apache with pidfile /var/run/httpd.pid
start program = "/etc/init.d/apache start"
stop program = "/etc/init.d/apache stop"
if failed port 80 protocol http then restart
if failed host 10.1.1.1 port 3306 then stop
alert address@hidden
depends on mysql
check process mmp with pidfile /var/run/mmp.pid
start program = "/etc/init.d/mmp start" stop program =
"/etc/init.d/mmp stop"
if failed port 110 protocol pop then restart
alert address@hidden
if failed host 10.1.1.1 port 110 then stop
if failed host 10.1.1.2 port 110 then stop
But, yes, you will miss out on the possibilities a depend tree can
provide. Hmm, I still like my proposal, but I can see that it's not so
flexible. How about a compromise? I think that it is a possibility
that host in your proposal could be mistaken for a real DNS host
record and not as a descriptive name, which in fact it is, so maybe we
should rewrite the statement to something like this?
check connection pop-backend2 on host 10.1.1.2 # or host xzzy.org
if failed port 110 then alert
alert address@hidden
PS. I know we are in a freeze, and I know that I'm shooting myself in
the foot when I suggest that we add this remote host test in the
upcomming 4.0 release. But the reason is that it's very useful, and it
is easy to realize. It will take me (or anyone of you) only about 1-2
hours to add this check.