monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test


From: Martin Pala
Subject: Re: test
Date: Sat, 30 Aug 2003 09:55:20 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030714 Debian/1.4-2

Jan-Henrik Haukeland wrote:

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

Nice shortcut :) On the other hand if you specify remote connection test in its own monitoring service instance, you can use remote monitoring specific tests (such as mentioned icmp), which need not to be supported in process monitoring class.


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

No problem - both notation (hostname or IP address) are usefull - in the case that the hostname is in hosts table (which is usual for critical hosts) there will be no problem. If the monit user wants not to depend on hosts table, he can choose raw form (IP address).



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.

You are rigth, the modification will be very simple and it is probably better to add it to 4.0. You choose :)

PPS. But the ICMP test you suggested in the other mail should be
postponed to a later release. It could be fun and I even have code
available for building a handmade ICMP ip-packet using a raw socket.

Super :)

Martin








reply via email to

[Prev in Thread] Current Thread [Next in Thread]