I'm trying to get this going on my new server:
I've installed it, but when I try and run any commands, it times out:
root@mail:~# monit status
/etc/monit/monitrc:298: Include failed -- Success '/etc/monit/conf.d/*'
/etc/monit/monitrc:299: Include failed -- Success '/etc/monit/conf-enabled/*'
Cannot create socket to [192.168.1.34]:2812 -- Connection timed out
my config in /etc/monit/monitrc has:
set httpd port 2812 and
use address 192.168.1.34 # only accept connection from localhost
# allow localhost # allow localhost to connect to the server and
# allow admin:monit # require user 'admin' with password 'monit'
... and when I reload, it looks fine:
root@mail:~# monit reload
/etc/monit/monitrc:298: Include failed -- Success '/etc/monit/conf.d/*'
/etc/monit/monitrc:299: Include failed -- Success '/etc/monit/conf-enabled/*'
Reinitializing monit daemon
Yet when I look at the status, I get the connection error. I have also tried doing it with 127.0.0.1, as that is what I get when doing ping localhost
from SSH
I'm using Ubuntu 16 BTW. I install Monit using:
sudo apt-get install monit
Any suggestions as to what I can check? I'm drawing a blank.
As requested, here is the output from netstat -tulpen
:
root@mail:~# netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 5001 16892 3763/python
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 109 178201 20577/mysqld
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 118 617295 24128/memcached
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 0 623080 26101/dovecot
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 625168 26188/nginx -g daem
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 15430 3624/sshd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 115 16232 3696/postgres
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 625170 26188/nginx -g daem
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 0 623016 26101/dovecot
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 0 623082 26101/dovecot
tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 0 16201 3739/slapd
tcp6 0 0 :::143 :::* LISTEN 0 623081 26101/dovecot
tcp6 0 0 :::80 :::* LISTEN 0 625169 26188/nginx -g daem
tcp6 0 0 :::8181 :::* LISTEN 0 16585 4284/apache2
tcp6 0 0 :::22 :::* LISTEN 0 15439 3624/sshd
tcp6 0 0 ::1:5432 :::* LISTEN 115 16233 3696/postgres
tcp6 0 0 :::443 :::* LISTEN 0 625171 26188/nginx -g daem
tcp6 0 0 :::4190 :::* LISTEN 0 623017 26101/dovecot
tcp6 0 0 :::993 :::* LISTEN 0 623083 26101/dovecot
tcp6 0 0 :::389 :::* LISTEN 0 16202 3739/slapd
udp 0 0 127.0.0.1:11211 0.0.0.0:* 118 617296 24128/memcached
udp 0 0 0.0.0.0:45852 0.0.0.0:* 5002 627092 25708/uwsgi
I also just tried a full server reboot, to see if that helped, but no difference. If I try and start monit again, I get:
root@mail:~# monit
Monit daemon with PID 3609 awakened
Here is the output from ufw status
:
root@mail:~# ufw status
Status: active
To Action From
-- ------ ----
Nginx Full ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
115/tcp ALLOW Anywhere
22 ALLOW Anywhere
8181 ALLOW Anywhere
2812 ALLOW Anywhere
Nginx Full (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
115/tcp (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
8181 (v6) ALLOW Anywhere (v6)
2812 (v6) ALLOW Anywhere (v6)
Below is what I get in the monit.log:
[BST Mar 31 09:33:22] info : Reinitializing monit daemon
[BST Mar 31 09:33:22] info : Awakened by the SIGHUP signal
Reinitializing Monit - Control file '/etc/monit/monitrc'
[BST Mar 31 09:33:22] info : Shutting down Monit HTTP server
[BST Mar 31 09:33:22] info : Monit HTTP server stopped
[BST Mar 31 09:33:23] info : Starting Monit HTTP server at [localhost]:2812
[BST Mar 31 09:33:23] info : Monit HTTP server started
[BST Mar 31 09:33:23] info : 'mail.etrust.pro' Monit reloaded
Then when doing a monit status
, I get:
[BST Mar 31 09:34:09] error : Denied connection from non-authorized client [127.0.0.1]
[BST Mar 31 09:34:09] error : Error receiving data -- Connection reset by peer