Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: me@mydomain.com }
set alert me@mydomain.com

set httpd port 2812 and
allow myuser:mypassword
SSL ENABLE
PEMFILE  /etc/monit/monit.pem

check system my.ip.he.re
    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 alert

include /etc/monit/conf.d/*.monitrc
share|improve this question

2 Answers 2

up vote 1 down vote accepted

Kyle's post prompted me to look at /etc/default/monit and I compared the setup to a newer server.

In older versions of monit you had a line such as CHECK_INTERVALS=30 in /etc/default/monit. This is no longer used and you have to now have a line that looks like set daemon 30 in your /etc/monit/monitrc file.

share|improve this answer

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.

share|improve this answer
    
Ehh.. I didn't read your question carefully enough, but I will leave this because it might be the answer for someone else who stumbles upon this from Google. –  Kyle Brandt Oct 21 '10 at 12:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.