Page 1 of 1

Monitoring the server

Posted: February 15th, 2013, 2:19 am
by ricksebak
What are you guys using for monitoring?

I'm using monit, which watches over processes, load, disk usage, etc, and then does what it's supposed to do on its own. If a process dies, monit can restart it. So it does a lot of work so that I don't have to do it. The monit site is http://mmonit.com/, and there is a more detailed installation howto here http://www.ubuntugeek.com/monitoring-ub ... monit.html

Obviously, monit can watch over media center related stuff the same as it can watch over anything else. But since this is a media center forum, here are a couple of my monit recipes that are more media center focused:

deluged.conf:

Code: Select all

  check process deluged with pidfile /var/run/deluged.pid
    group noncritical
    start program = "/etc/init.d/deluge-daemon start" with timeout 60 seconds
    stop program  = "/etc/init.d/deluge-daemon stop"
    if cpu is greater than 80% and loadavg(1min) is greater than 4 then restart
    if not exist then start
    if 10 restarts for 10 cycles then alert
samba.conf (which is basicly the same as the examples on the monit site):

Code: Select all

  check process samba with pidfile /var/run/samba/smbd.pid
    start program = "/etc/init.d/smbd start" with timeout 60 seconds
    stop program = "/etc/init.d/smbd stop"
    if failed host 192.168.1.2 port 139 type TCP  then restart
    if 5 restarts within 5 cycles then timeout
disks.conf:

Code: Select all

CHECK FILESYSTEM sda1 with PATH /
        if space usage > 90 % then alert
        if inode usage > 85 % then exec "/usr/bin/find /tmp -ctime +2h -delete"
        if inode usage > 90 % then alert

CHECK FILESYSTEM shadow with PATH /hot/sdb5
        if space usage > 90 % then alert
        if inode usage > 85 % then exec "/usr/bin/find /hot/sdb5/tmp -ctime +2h -delete"
        if inode usage > 90 % then alert
Those may not be perfect and could probably be better, but they work well enough for me.

Re: Monitoring the server

Posted: February 15th, 2013, 8:38 am
by Ian
Hi there and welcome to the forums :thumbup:

I've not heard of monit before. I'll definitely be taking a look. Thanks for the tip :clap:

Ian.