Friday, December 4, 2009

INSTALL Monit for Monitor System

I/INTRO

Monit is a free open source utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

II/INSTALL

Step 1:Install monit

#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#yum install monit
#chkconfig --levels 235 monit on

Step 2:Config Monit

edit /etc/moni.d/monitrc
set daemon  60
set logfile syslog facility log_daemon
set mailserver localhost #mail server
set mail-format { from: monit@server1.example.com }
set alert root@localhost #alert to admin with email adrress root@localhost
set httpd port 2812 and
SSL ENABLE
PEMFILE /var/certs/monit.pem
allow admin:test

some features example of monit

*check host CUIBAP with address 19.16.12.32
if failed icmp type echo with timeout 20 seconds then alert
(check host if over 20 second it will alert mail to admin)

*check host CONHEO with address 132.163.193.3
if failed port 25 with timeout 30 seconds then alert
(check Service SMTP if over 30 second it will alert mail to admin)

*check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed port 22 protocol ssh then restart
if failed port 22 protocol ssh then alert
if 5 restarts within 5 cycles then timeout
(check Service SSH if it down monit auto start only run in localhost)

Step 3:access monit via web mail port 2812


No comments:

Post a Comment