[Top][All Lists]

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

Re: Monit starts, but isn't listening on port

From: Martin Pala
Subject: Re: Monit starts, but isn't listening on port
Date: Fri, 16 Aug 2013 12:05:24 +0200


pelase check the Monit log. he most likely root cause is, that Monit was 
started before the network interface was enabled, so the specific bind to 
"" failed, as the interface was not available yet.

I'd suggest to remove the following option: "use address" (monit will 
listen on any interface, so when is enabled after monit is started, 
it'll work).

Additional notes for the configuration:

1.) the "telnet 2812" test will fail if you're testing it from the machine locally (source and destination IP will be in such 
case), as there is not "allow" 

2.) because the "use address" is used, the "allow localhost" has no 

If you'll remove the "use address" as suggested above, the "allow 
localhost" will have effect (as "monit status" will be able to connect via 
localhost), also the listening problem should be fixed. For the "telnet 2812" to work from the same machine you'll need to add "allow" to the config (but technically it's not necessary, as the connection 
from to won't be necessary if the specific bind is dropped).


On Aug 15, 2013, at 9:17 PM, Ted Fines <address@hidden> wrote:

> Problem: When Monit starts at boot on some systems, the monit process is 
> started, but is not listening on port 2812.
> I have 8 systems, all running Scientific Linux 6.4 (a free version of RHEL, 
> like CentOS).
> I had installed Monit 5.5.1 on each and had registered each with M/Monit.  
> Monit is started using upstart, using the included sample init script, which 
> works great.
> I recently rebooted them.  Monit started up on all of them, but on about 
> one-half of the systems Monit is not listening on http port 2812, as defined 
> in /etc/monitrc.  As a result when I try to view the system from M/Monit, I 
> only get “Cannot connect to Monit – Connection refused.”
> Below, you can see from my commands and the output that Monit is running but 
> not listening on the port:
> # status monit
> monit start/running, process 1211
> # ps -efwww | grep monit
> root      1211     1  0 Aug14 ?        00:00:18 /usr/local/bin/monit -c 
> /etc/monitrc
> # telnet 2812
> Trying
> telnet: connect to address Connection refused
> # lsof -i -P | grep monit
> #
> Here’s  /etc/monitrc:
> # grep -v "^#" /etc/monitrc
> set daemon  60              # check services at 1-minute intervals
> set eventqueue basedir /var/monit slots 1000
> set mmonit https://admin:address@hidden:8443/collector
> set httpd port 2812 and
>     use address  # Listen on main interface
>     allow localhost       # allow localhost to connect to the server and
>     allow        # allow M/Monit to connect to the server and
>     allow admin:********        # require user 'admin' with password 'monit'
> Now see how if I just stop & start monit again, it is listening on the port.  
> It is then also immediately available from M/Monit.
> # stop monit && start monit && lsof -i -P | grep monit
> monit stop/waiting
> monit start/running, process 4217
> monit      4217      root    5u  IPv4 315056      0t0  TCP 
> #
> This is problematic, having the monitoring agent think it is running 
> correctly when it is not.  Anyone else run into this?  What did you do?
> Thanks,
> Ted
> --
> To unsubscribe:

reply via email to

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