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.

How can you make sure that monit is always running?

At the moment it's silently falling over and leaving the server unmonitored.

Server is running on CentOS.

share|improve this question

2 Answers 2

The best thing to do is trying to know what causes it to stop unexpectedly and then fixing it.

As a temporary/complementary remedy, you can run a cron job to monitor monit process and start it when it is not running.

share|improve this answer
    
something like "service monit start" running every hour? –  Adam Jimenez Dec 3 '11 at 20:02
    
Yes, it is possible. However, you have to make sure you don't start multiple monit instances. Again, it is recommended first to see what is causing this stopping. –  Khaled Dec 3 '11 at 20:07

The best way to keep monit running is to use monit :) Maybe...

Since you're using CentOS, are you running the packaged version of Monit from RPMForge (versus compiling your own)? If so, you can easily add logging to your Monit instance by uncommenting the set logfile directive in following stanza of your monit.conf config file...

## Set syslog logging with the 'daemon' facility. If the FACILITY option is
## omitted, Monit will use 'user' facility by default. If you want to log to
## a standalone log file instead, specify the full path to the log file
#
set logfile syslog facility log_daemon
#

Doing so will enable syslog and will output to /var/log/messages. From here, you can examine why the daemon fails. Also consider posting your config here.

share|improve this answer
    
yes I am running the RPMforge version. I've uncommented the directive and see what it comes up with, thanks. –  Adam Jimenez Dec 3 '11 at 20:01

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.