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
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 firstname.lastname@example.org # 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 email@example.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:
Save and close the file. Start the monit Linux monitor tool / service:
# /etc/init.d/monit start
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop