About Linux FAQ

Browse More FAQs:

Ubuntu / Debian Linux: Install Monit Linux Server Monitoring Utility

Posted by Vivek Gite [Last updated: June 11, 2008]

This FAQ is part 1 of 3 in the series Linux Server Monitor

Q. How do I install monit to monitor my server under Debian / Ubuntu Linux?

A. monit is a utility for managing and monitoring processes, files, directories and devices on a Debian / Ubuntu Linux server system. Common monit usage:
a) Monit can start a process if it does not run
b) Restart a process if it does not respond
c) Stop a process if it uses to much resources etc

How do I install monit utility for monitoring services?

Simply type the following command as the root user:
$ sudo apt-get update
$ sudo apt-get install monit

Configure monit

Open monit configuration file /etc/monit/monitrc using vi text editor:
# vi /etc/monit/monitrc
You need to set following parameters:
set daemon 120
set logfile syslog facility log_daemon
set mailserver localhost # primary mailserver
set alert vivek@nixcraft.com # receive all alerts

Save and close the file. Where,

  • set daemon 120 : Start monit in background as daemon and check the services at 2-minute intervals.
  • set logfile syslog facility log_daemon : Log messages in /var/log/messsages file
  • set mailserver localhost : Send email alert via localmail server such as sendmail. Set list of mailservers for alert delivery. Multiple servers may be specified using comma separator. By default monit uses port 25 - it is possible to override it with the PORT option.
  • set alert vivek@nixcraft.com : You can set the alert recipients here, which will receive the alert for each service. The event alerts may be restricted using the list.

Now open /etc/default/monit file to turn on monit service:
# vi /etc/default/monit
Set startup to 1, so monit can start:
startup=1
Save and close the file. Start the monit Linux monitor tool / service:
# /etc/init.d/monit start

Navigation for Linux Server MonitorMonit: Monitor SSHD Server and Auto Restart SSH If It Does Not Respond»

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.