18
MONIT UNIX System Management Amit Solanki http://vinsol.com [email protected]

Monit - Introduction, Configuration & Usage

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Monit - Introduction, Configuration & Usage

MONIT UNIX System Management

Amit Solankihttp://[email protected]

Page 2: Monit - Introduction, Configuration & Usage

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

Page 3: Monit - Introduction, Configuration & Usage

daemon mode - poll programs at a specified intervalmonitoring modes - active, passive or manualstart/stop/restart of programsgroup and manage groups of programsprocess dependency definitionlogging to syslog or own logfileconfiguration - comprehensive control fileruntime and tcp/ip port checking (tcp & udp)ssl support for port checkingunix domain socket checkingprocess status and process timeout

Supports

Page 4: Monit - Introduction, Configuration & Usage

process CPU usage, memory usage, zombie checkcheck the systems load averagecheck a file or directory timestampalert/stop/restart a process based on its characteristicsalert notice for program timeout, restart, checksum, stop resource & timestamp errorflexible and customizable email alert messagesProtocol verification: HTTP, FTP, SMTP, POP, IMAP, NNTP, SSH, DWP, LDAPv2 and LDAPv3An http interface with optional SSL support to make monit accessible from a web browser

Supports

Page 5: Monit - Introduction, Configuration & Usage

How To Monitor?configured & controlled via a control file called monitrc

default location: ~/.monitrcalternate : /etc/monitrc & ./monitrc

test for syntax error[root@param ~]# monit -tControl file syntax OK

starting monit[root@param ~]# monitmonit daemon at 16388 awakened

stopping monit[root@param ~]# monit quitmonit daemon with pid [16388] killed

Page 6: Monit - Introduction, Configuration & Usage

The Monit Control FileThree types of statement

Global set-statementsstarts with keyword set and the item to configureset alert [email protected] # Alert system admin on any event

Global include-statementsconsists of keyword include and a glob stringinclude /etc/monit/mysql.monitrc

One or more service entry statementsstarts with the keyword check followed by the service typecheck system example.com

if memory usage > 75% then alert

Page 7: Monit - Introduction, Configuration & Usage

Available Actions

If <TEST> THEN <ACTION>Available actions

alertrestartstartstopexecunmonitor

Page 8: Monit - Introduction, Configuration & Usage

Global Statements

Page 9: Monit - Introduction, Configuration & Usage

Monitoring Process

Apache

Page 10: Monit - Introduction, Configuration & Usage

Monitoring Process

Mysql

Page 11: Monit - Introduction, Configuration & Usage

Monitoring Process

Mongrel

Page 12: Monit - Introduction, Configuration & Usage

Monitoring Process

Mongrel Clusters

Page 13: Monit - Introduction, Configuration & Usage

Monitoring Process

Solr

Page 14: Monit - Introduction, Configuration & Usage

capistrano + monit

Page 15: Monit - Introduction, Configuration & Usage

Web Interface

Page 16: Monit - Introduction, Configuration & Usage

Demo

Page 17: Monit - Introduction, Configuration & Usage

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

Page 18: Monit - Introduction, Configuration & Usage

Thanks !!!