2

I want to use monit to monitor services on my Ubuntu VM(precise 32) but I cannot access the monit daemon via HTTP from the host (local) machine.

I have enabled the following settings in /etc/monit/monitrc:

set httpd port 2812 and
  use address localhost
  allow localhost
  allow vagrant:vagrant_pwd

and have forwarded port 2812 in the virtual machine to host machine in Vagrantfile as follows:

config.vm.forward_port 2812, 2812

I have confirmed that monit is running on the virtual machine by ssh'ing into the VM and running:

sudo /etc/init.d/monit status

and can access the Monit daemon using HTTP within the VM by running

curl -u vagrant:vagrant localhost:2812

but when I enter localhost:2812 on the host machine browser (firefox) I get no response.

Any ideas on how to make this work?

Binary Maze
  • 233
  • 5
  • 11

2 Answers2

5

This answer helped me: https://stackoverflow.com/a/5999945/262972

When I set my monitrc to the following, I was able to connect at 33.33.33.10:3737

set httpd port 3737 and
    use address 0.0.0.0
    allow admin:"password"
Noli
  • 341
  • 1
  • 3
  • 8
-1

I met the same problem on my Debian box.

I discovered that if I exec command "monit reload" after any modification to monitorc file the httpd server can be started correctly.

so maybe what you need is just executing "monit reload" every time you have made some change to the configuration files.

ehe888
  • 1