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
I was struggling to setup monit on my ubuntu server and here are a few things to check:
One last "gotcha" in /etc/monit/monitrc:
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.
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.
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.I'v added this lines my conf file
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.
I got: Cannot create socket to [localhost]:2812 -- Connection refused
until I rebooted the VM.. as in windows: reboot is good after installing monit
I got: Cannot create socket to [localhost]:2812 -- Connection refused
On ubuntu 20.04... until I udated the monitrc file to set the httpd settings and then ran:
sudo systemctl restart monit.service
This last part was key.