0

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.

Adam Jimenez
  • 155
  • 2
  • 7

2 Answers2

0

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.

Khaled
  • 35,688
  • 8
  • 69
  • 98
  • something like "service monit start" running every hour? – Adam Jimenez Dec 03 '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 03 '11 at 20:07
0

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.

ewwhite
  • 194,921
  • 91
  • 434
  • 799