I installed monit and tried to check the status using below command.
monit status
But end up with below error.
monit: error connecting to the monit daemon
How can I fix this?
Stop one of the monitored services, like nginx or node-app and wait for monit to restart it. Stop nginx. Wait 2 minutes. View the end of the monit log for when it restarted nginx.
Monit is a free, open-source process supervision tool for Unix and Linux. With Monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server. Monit is able to do automatic maintenance, repair, and run meaningful causal actions in error situations.
Monit has a web interface that runs on port 2812 using a web server. To enable the web interface you need to make changes in the monit configuration file. The main configuration file of monit located at /etc/monit. conf under (RedHat/CentOS/Fedora) and /etc/monit/monitrc file for (Ubuntu/Debian/Linux Mint).
How to monitor? Monit is controlled via an easy to configure control file with a simple syntax. The file is called monitrc and resides in your home directory. An example monitrc file is included with the Monit download.
edit vim /etc/monit/monitrc
, starting from line 118 and uncomment below lines
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
sudo monit reload
to take affect
Read more
Sometimes the problem appears because loopback interface is down . We should bring up the lo interface as follow
root@server:~# ifup lo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With