2. What Is Monit?
utility for monitoring and managing daemons(and
similar processes), files and directories and
devices running on unix systems
starts specified program if they are not
running or restarts when they are not
responding
3. Supports
daemon mode - poll programs at a specified
interval
monitoring modes - active, passive or manual
start/stop/restart of programs
group and manage groups of programs
process dependency definition
logging to syslog or own logfile
configuration - comprehensive control file
runtime and tcp/ip port checking (tcp & udp)
ssl support for port checking
unix domain socket checking
process status and process timeout
4. Supports
process CPU usage, memory usage, zombie check
check the systems load average
check a file or directory timestamp
alert/stop/restart a process based on its
characteristics
alert notice for program timeout, restart,
checksum, stop resource & timestamp error
flexible and customizable email alert messages
Protocol verification: HTTP, FTP, SMTP, POP,
IMAP, NNTP, SSH, DWP, LDAPv2 and LDAPv3
An http interface with optional SSL support to
make monit accessible from a web browser
5. How To Monitor?
configured & controlled via a control file
called monitrc
default location: ~/.monitrc
alternate : /etc/monitrc & ./monitrc
test for syntax error
[root@param ~]# monit -t
Control file syntax OK
starting monit
[root@param ~]# monit
monit daemon at 16388 awakened
stopping monit
[root@param ~]# monit quit
monit daemon with pid [16388] killed
6. The Monit Control File
Three types of statement
Global set-statements
starts with keyword set and the item to configure
set alert amitkssolanki@gmail.com # Alert system admin on any event
Global include-statements
consists of keyword include and a glob string
include /etc/monit/mysql.monitrc
One or more service entry statements
starts with the keyword check followed by the
service type
check system example.com
if memory usage > 75% then alert
17. Coming up:
God, like monit
Config file written in ruby
Easily write your own custom conditions in ruby
Supports both poll and event based conditions
Different poll conditions can have different
intervals
Integrated notification system
Easily control non-daemonizing scripts