Monitoring the server

Got any great tips or tricks you're dying to share with the rest of the world? Then please post them here.
They don't have to be specifically related to building a media server but please do try to keep them suitably "geeky".
ricksebak
Member
Member
Posts: 33
Joined: February 10th, 2013, 10:34 pm

Monitoring the server

Postby ricksebak » February 15th, 2013, 3:19 am

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-ubuntu-services-using-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.

User avatar
Ian
Moderator
Posts: 751
Joined: January 1st, 2011, 8:00 am

Re: Monitoring the server

Postby Ian » February 15th, 2013, 9:38 am

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.


Return to “Tips 'n' Tricks”

cron