How can I access monit http remotely
Asked Answered
D

4

8

I have been trying for hours to configure monit so I can access it remotely from a web browser from http://:2812 but it always times out. I have Nexus running on the same instance at http::8081 so I know basic connectivity works: My monitrc contains

set httpd port 2812
#     use address localhost  # only accept connection from localhost
     allow localhost        # allow localhost to connect to the server and
     allow admin:monit      # require user 'admin' with password 'monit'
     allow 50.67.165.130    # remote host

Where remote host is where I am trying to connect from. Is there some other special magic to be able to access the monit httpd remotely?

Strange that this has to be so hard.

Dronski answered 20/4, 2015 at 21:17 Comment(0)
F
9

I have been through the same problem, I dont think the configuration likes comments right below the "set", try to put the lines without comments right below the "set". For example:

 set httpd port 2812
        allow admin:monit

Do also watch the log for errors:

tail -f /var/log/monit.log
Frigg answered 11/5, 2015 at 18:57 Comment(1)
I think you're misunderstanding one aspect. use and allow are both significant, and commenting out use is incorrect for that reason, not because of a special dislike.Miyasawa
M
5

I had the same issue for hours but finally solved.

In case you're using a firewell (ufw in my case), just add a rule to allow the trafic for the port:

sudo ufw allow 2812/tcp

2812 being the port you're trying to connect from, then http://your-ip-adress:2812

Mclaren answered 13/5, 2020 at 17:6 Comment(0)
V
1

You have to configure Monit to allow remote access by adding your remote system IP address. We can add multiple IP addresses to access the HTTP interface from multiple systems as shown below.

  set httpd port 2812 and
 #     use address localhost  # only accept connection from localhost
     allow localhost        # allow localhost to connect to the server and
     allow 50.67.165.130    # remote host
     allow 50.67.165.135    # remote host
     allow admin:monit      # require user 'admin' with password 'monit'

Also, open the port 2812 by updating your firewall.

You have misses the and after the port number which is causing issues with your installation.

Also refer Install Monit On Ubuntu for complete details.

Verwoerd answered 10/6, 2020 at 6:16 Comment(0)
K
1

What you can also setup is

allow 0.0.0.0/0.0.0.0

but before you do, check also if you restricted connections to an address like localhost

Karbala answered 13/10, 2020 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.