我试图让我的新服务器:
https://mmonit.com/monit/
我已经安装了它,但是当我尝试并运行任何命令时,它超时:
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
我在/ etc / monit / monitrc中的configuration有:
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'
…当我重新加载,它看起来很好:
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
然而,当我看到状态,我得到连接错误。 我也尝试过使用127.0.0.1,因为这是从SSH执行ping localhost时候得到的
我正在使用Ubuntu 16 BTW。 我安装Monit使用:
sudo apt-get install monit
任何build议,我可以检查什么? 我正在画空白。
根据要求,这里是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
我也只是尝试一个完整的服务器重新启动,看看是否有帮助,但没有区别。 如果我尝试再次开始监视 ,我会得到:
root@mail:~# monit Monit daemon with PID 3609 awakened
这是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)
以下是我得到的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
然后当做一个monit status ,我得到:
[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
问题是/etc/monit/monitrc缺lessallow和use address指令。 被configuration@AndrewNewby可以连接到他的monit-httpd。