Linux – after installing monit when i do monit status theproc i get “error connecting to the monit daemon”

linuxmonit

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

I read somewhere that

The status command won't work in the
case that monit is running indaemon
mode without its http support – the
command 'monit status' in such case
tries to get the status from the
daemon via http/tcp. To start the http
interface you need to add the 'set
httpd …' statement to
theconfiguration.

is that still correct? that post was from 2005

Best Answer

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.