monit-dev
[Top][All Lists]
Advanced

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

Re: statement changes suggestions


From: Martin Pala
Subject: Re: statement changes suggestions
Date: Sun, 03 Aug 2003 21:47:58 +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:

Today the connection test checks a port (and possibly the protocol at
the port) and if an error occurs, monit restarts the server.

This may not always be the behavior you want. Instead of blindly
restarting the service the user should have the possibility to choose
between different actions; alert, restart, stop and exec. In other
words the connect test should be more similar to the timestamp and
resource statement.

This include rewriting the statement to look more like an if-test.
Here's a proposal, consider the following port statement:

host www.sol.no port 80 protocol http

It should/could be rewritten to:

IF FAILED host www.sol.no port 80 protocol http THEN [ALERT | STOP | RESTART | EXEC]

Likewise the checksum statement could also be rewritten to become a
more general purpose statement as follows:

IF FAILED checksum /usr/bin/httpd and expect the sum 4e5309d1956f003bcdff168748bea647
THEN [ALERT | STOP | RESTART | EXEC]

What do you think?

Yes :) My +1 for it.

What about to move FAILED behind the target specification, as it is in other tests (like 'if timestamp changed then ...' or 'if size < 10 KB then ...')? It seems more natural for me:

IF host www.sol.no port 80 protocol http FAILED THEN [ALERT | STOP | RESTART | 
EXEC]

IF checksum /usr/bin/httpd and expect the sum 4e5309d1956f003bcdff168748bea647 
FAILED THEN [ALERT | STOP | RESTART | EXEC]


Martin









reply via email to

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