Aug 14, 2011

Monit not starting after OS upgrade to Ubuntu 10.04 LTS


Iv recently upgraded the version of Ubuntu from 9.04 to 10.04LTS (through 9.10) and now Monit won’t start. Doing a sudo /etc/init.d/monit syntax says the syntax is ok. If I run the command sudo /etc/init.d/monit start I get Starting daemon monitor: monit. However if I do a ps -ef, then monit is not listed.

If I dig into the /etc/init.d/monit file then i can see that the executable that gets run is /etc/monit/monitrc. Running this with sudo gives an output of

/etc/monit/monitrc: 6: allow: not found
/etc/monit/monitrc: 7: SSL: not found
/etc/monit/monitrc: 8: PEMFILE: not found
/etc/monit/monitrc: 10: check: not found
/etc/monit/monitrc: 11: Syntax error: word unexpected (expecting ")")

My control file is below:

set mailserver localhost
set mail-format { from: }
set alert me@mydomain.comset httpd port 2812 and
allow myuser:mypassword
PEMFILE  /etc/monit/monit.pemcheck system
    if loadavg (1min) > 4 then alert
    if loadavg (5min) > 2 then alert
    if memory usage > 60% then alert
    if cpu usage (user) > 70% then alert
    if cpu usage (system) > 70% then alert
    if cpu usage (wait) > 70% then alertinclude /etc/monit/conf.d/*.monitrc


I am not entirely sure, but perhaps there is one of those default files for monit that needs to be enabled in /etc/default ?

Since the monit file in /etc/init.d/ is shell script, you can run sudo bash -x /etc/init.d/monit start which will trace the script on your screen and might show you where you are going wrong.

Related posts:

  1. How to disable Monit instance start/stop alerts?
  2. How to upgrade from Ubuntu 9.04 to 10.04 LTS
  3. Monit can’t detect MySQL, but I can
  4. Monit is restarting apache2, should I fix the monit config, or the server config?
  5. Setting umask for www-data user (run via sudo) on Ubuntu 10.04 LTS

Leave a comment