On Thu, Jun 16, 2011 at 6:29 PM, Jan-Henrik Haukeland
<address@hidden> wrote:
On Jun 17, 2011, at 12:00 AM, Martin Konecny wrote:
> I also saw unmonitor as a command-line parameter to monit, but this requires monit to be started with http support. We want to include monit with our open-source software that will be shipped on to thousands of systems. It would problematic to modify the monit init.d scripts for every users system. Is there any other way?
The way to do this (and mentioned earlier in this thread) is to use the unmonitor or stop command line parameter. For instance; 'monit unmonitor apache' and then when you want to enable monitoring again, 'monit monitor apache'. You are correct that this requires the http interface enabled, but this is strongly recommended in any case as otherwise you will lose out on many useful features. What you do is enable the http interface on localhost only. This way you wont have to modify the init.d script. Only binding to localhost should be secure, especially if you add basic authentication credentials:
set httpd port 2812 and use address 127.0.0.1
# SSL enable pemfile /some/path/monit.pem
# allowselfcertification
allow localhost
allow admin:monit