Terry : Monit

Monit and M/Monit

Install

Compile from source

tar zxvf monit-x.y.z.tar.gz
cd monit-x.y.z
./configure
make && make install

NOTE: use ./configure --help to view available options

Use the pre-compiled binary for Linux x86_64

tar axvf monit-5.5-linux-x64.tar.gz

Test the config file for syntax errors

$ monit -t -c ../conf/monitrc

Start monit

./monit -c ../conf/monitrc
$ /bea/monit/monit-5.5/bin/./monit -c ../conf/monitrc

Stop monit

monit quit

Example

./monit -c ../conf/monitrc quit
monit daemon with pid [pid] killed

Control file - monitrc

set httpd port 2812 and
use address support.au.oracle.com # only accept connection from support.au.oracle.com
allow localhost # allow localhost to connect to the server and
allow 10.0.0.0/8
allow 10.1.1.1
allow terry:"monit" # require user 'terry' with password 'monit'
allow @monit # allow users of group 'monit' to connect (rw)
allow @users readonly # allow users of group 'users' to connect readonly

To monitor sshd

sshd
# Check SSH Server
check process sshd with pidfile /run/sshd.pid
start program "/etc/init.d/ssh start"
stop program "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout

Examples

http://mmonit.com/wiki/Monit/ConfigurationExamples

Presentation

http://mmonit.com/monit/documentation/monit.pdf

http://mmonit.com/monit/documentation/monit.html

Reference

http://mmonit.com/monit/

http://mmonit.com/

http://www.unixmen.com/howto-install-monitorix-in-ubuntu-fedora-and-centos/

http://www.ubuntugeek.com/monitoring-ubuntu-services-using-monit.html

http://www.howtoforge.com/server-monitoring-with-munin-and-monit-on-debian-lenny