Installing Monit on ubuntu

sudo emacs  /etc/monit/monitrc
sudo /etc/init.d/monit start
sudo monit status

Ref :

http://howtonode.org/deploying-node-upstart-monit

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

http://www.darkcoding.net/software/setting-up-monit-on-ubuntu/

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

This screenshot was really helpful :

http://fosscasts.com/screencasts/6-System-Monitoring-With-Monit

I got this code from above screen shot :

/etc/monit/monitrc file I used:

set daemon 20
set logfile /var/log/monit.log

set mailserver smtp.gmail.com port 587
        username "myemail" password "mypswd"
        using tlsv1
        with timeout 30 seconds

set alert myemail

set httpd port 2812 and
        use address myurldns.net
        allow myurldns.net
        allow admin:monit

check system localhost
        if loadavg (1min) > 4 then alert
        if loadavg (5min) > 2 then alert
        if memory usage > 75% then alert
        if cpu usage (user) > 70% then alert
        if cpu usage (system) > 30% then alert
        if cpu usage (wait) > 20% then alert

check process apache2 with pidfile /var/run/apache2.pid
        group www
        start program = "/etc/init.d/apache2 start"
        stop program  = "/etc/init.d/apache2 stop"
        if children > 250 then restart
        if loadavg(5min) greater than 10 for 8 cycles then stop
        if 3 restarts within 5 cycles then timeout
Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in Node.js, Ubuntu/Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s