monit: error connecting to the monit daemon

monit: error connecting to the monit daemon

monit: error connecting to the monit daemon We’re rolling out monit on our new platform at the request of a vendor to manage their new service. I’ve always been dead against these kinds of automated failure recovery tools as they often require human intervention after the fact anyway and all the platforms I’ve managed will have failed the server anyway so why not restart the services after the root cause analysis is done? My tune is slowly changing though and I’m coming to appreciate this method of systems recovery a lot more.

Whilst playing with it though I got the following error

root@newshiny:~# monit summary
monit: error connecting to the monit daemon

What what? The daemon’s definitely running, why can’t I pole it’s status?

root@newshiny:~# ps aux | grep monit
root 325293 0.0 0.0 16440 1276 ? Sl Mar27 0:10 /usr/bin/monit
root 496627 0.0 0.0 105348 832 pts/0 S+ 11:43 0:00 grep monit
root@newshiny:~# service monit status
monit (pid 325293) is running...

After reading the documentation this monit: error connecting to the monit daemon seemed to be an epic case of rushing in to things, skimming the documentation and PEBCAK!

Solving monit: error connecting to the monit daemon

Monit can present an HTTP interface which I didn’t enable as I thought it was just for me, it turns out it’s also for the command line tools!

It’s really easy to enable, in /etc/monit.conf or wherever your conf file is located just add

set httpd port 2812 and
use address localhost
allow localhost

and restart monit with

service monit restart

and Bob’s your mother’s brother.

root@newshiny:~# netstat -lpn | grep 2812
tcp 0 0* LISTEN 325293/monit

root@newshiny:~# monit summary
The Monit daemon 5.2.5 uptime: 19h 18m

Process 'shiny_manager' running
Process 'shiny_proxy' running
Process 'shiny_server' running
System 'system_newshiny' running

Problem solved!

  1. Funny how they don’t mention that command line tools need this…along the same lines, I believe you can add another ‘allow’ line that specifies your computer’s ip address so you can access the web interface. Is that how the web interface works or no? Just remember to leave in ‘allow localhost’

Leave a Reply

Your email address will not be published. Required fields are marked *