Skip to content


Using monit with Ubuntu Server

Monit is a software watchdog – a very useful tool to keep your service daemons alive.

The best way to run monit is as the Init managed process. But there is no /etc/inittab on Ubuntu anymore. Instead we have Upstart. Adding Monit as an Upstart service is easy. Let me show you how…

Upstart is event based, and its event handling configuration is in /etc/event.d. The configuration is a bit similar to /etc/inittab, but a bit more verbose and placed in separate files. To add Monit as a managed process, just create a file similar to a getty spawner configuration in ttyX. I named my file: /etc/event.d/monit with content of:

# Run monit in standard run-levels
start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6
respawn
exec /usr/sbin/monit -Ic /etc/monit/monitrc

Next just start monit. Issue a command:
start monit

Good luck with service monitoring.


Posted in HowTo, Software.

Tagged with , , , , .


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Tomasz says

    But… what do you need monit for, when you have upstart?

  2. Tomasz Sterna says

    Can Upstart check whether a deamon prompts a defined string on TCP port?
    Can Upstart alert you on high server load then find and kill misbehaving process?
    Can Upstart fix and report resource limits?
    I could go on… ;-)

  3. Christian Roessner says

    Thanks fpr the upstart script. :-)

You must be logged in to post a comment.