after installing monit when i do monit status myproc i get "error connecting to the monit daemon"

Solution 1:

I was struggling to setup monit on my ubuntu server and here are a few things to check:

  • Make sure that you set startup=1 in /etc/default/monit
  • Make sure to un-comment the httpd parameters in /etc/monit/monitrc

One last "gotcha" in /etc/monit/monitrc:

set daemon  120           # check services at 2-minute intervals
#  with start delay 240  # optional: delay the first check by 4-minutes (by
#                           # default Monit check immediately after Monit start)

I had the "with start delay 240" line un-commented at first. It appears that the httpd server will not start immediately if you use this option. It took me awhile to realize why monit was running but the httpd server was not.

Solution 2:

 set httpd port 2812 and
  use address 0.0.0.0
  allow 0.0.0.0/0.0.0.0
  allow admin:monit

I think this is better,it will add a web page to see the monit result,and the user name and password is admin and monit.

Solution 3:

In order to make this work, you have to set the monit httpd process to allow connections from localhost.

In your config file, you should uncomment the line that says allow localhost and restart monit.

Solution 4:

I'v added this lines my conf file

set httpd port 2812 and
use address localhost
allow localhost

Solution 5:

Make sure you have enabled the HTTP daemon and added allow localhost. There's a write up on how to correctly configure monit to avoid this error here.