Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access monit http remotely

Tags:

monit

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.

like image 904
Eric Kolotyluk Avatar asked Apr 20 '15 21:04

Eric Kolotyluk


2 Answers

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
like image 188
user3185936 Avatar answered Sep 20 '22 03:09

user3185936


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

like image 40
San Francesco Avatar answered Sep 19 '22 03:09

San Francesco