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?