Home Random Sh17cast Forums

Using Monit to keep your services online

Tuesday, December 1, 2009

Thesh17’s been running on a linode VPS for a month or so now.   It works great until it gets railed, and apache dies.     Then a few hours later I notice the site’s down and login to restart it.    Originally I wrote a shell script that would just check if httpd was running.  If it wasn’t, it’d start it.   It’d also check the output of ‘free -m’ and if memory usage(not counting buffers) was greater than 90%, restart apache.

You’d think that’d be good, right?  Wrong.   I don’t know why, but occasionally things would get confused.  It’d see httpd running, but it wasn’t serving any pages on port 80.    service httpd status would show it was stopped, but the script didn’t check http connectivity or the actual pid file. I honestly didn’t troubleshoot this much, and just manually killed the processes/restarted httpd.

I decided to search for some scripts similar to mine(and better), but instead ended up landing on a utility called Monit.   It’s basically a service monitor you can run(locally or remotely) and depending on different conditions, it will restart the service and make sure it’s running.     This can be as simple as the pid in the pid file not existing, or more complex like the process has been using 90% of the cpu for the last 30 minutes.

As an example, here’s what my apache monit config looks like right now:

check process httpd with pidfile /var/run/httpd.pid
group apache
start program = "/sbin/service httpd start"
stop program = "/sbin/service httpd stop;pkill -9 httpd"
if failed host port 80 protocol http then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if children > 150 then restart
if loadavg(5min) greater than 10 for 8 cycles then alert
if memory > 90% for 2 cycles then restart
if 5 restarts within 5 cycles then timeout

Monit is pretty simple to install. It’s available in most distro’s repositories. On centos:

root@server:# yum install monit

On Gentoo:

root@server:# echo "=app-admin/monit-5.0.3" >> /etc/portage/package.keywords;
root@server:# emerge -av monit

I’m going to give Monit a try for a few weeks and see how it works out. I’ve been using nagios lately as well, but it seems kind of cumbersome to me and mainly one used for monitoring/reporting. Monit will actually restart a service if it detects a problem which *usually* is a good thing.

posted by johntash at 4:25 pm  

3 Things You Cant LIve Without

Thursday, May 29, 2008

So, JT thinks its cool not to post anything and make us look like a bunch of slackers, but im here to fix that.

Three things you cant live without

Number 1: Are you sick and tired of the stock windows bar? that strange blue and the even stranger green start tab? Well your in luck. Some time ago Microsoft released the Zune windows theme. Now i know that there are a million different themes out there. but this one looks pretty cool i might say. It sports a bright orange start bar with a charcoal black application tray. Along with that all of your applications now have a somewhat glossy black bar instead of the ugly….wait…what color was it? I guess ive had this theme for so long i forgot. Anyway, give it a try, it darkens up your desktop and looks snazzy! Click this link to go right to the download.

Number 2: *Double click WMP or Itunes* * wait 45 minuets for your 500gigs of music to load* we’ve all experienced it. Boggy media players that load every song…and take 5 minutes to do so. Well here be the solution to YE woes. MediaMonkey is a taste little chuck of free ware to manage ALL of your media needs. Its a media player, video, picture viewer, and on top of that it keeps all your podcasts subscriptions in line. But thats not the best part, MediaMonkey wont lag at all on start up unless you have 50,000+ songs. Now i don’t know about you but i have 34gigs of music, and thats only 6,000 songs. So if you’ve got enough music to bog this down them you’ve got to much music. Additional features include: downloadable skins * there are hundreds* and streaming throughout your network. Go check it out, it makes life dandy. MediaMonkey

Number 3: Do you play WoW? CSS? BF24300? Or any other game that you want to take a screen shot of? Or do you just like to take screen shots? Well as most of us do/have done, you press print screen, open MS-Paint and paste it, save it, and send the 3meg image to your friend. Takes forever eh? Well a few weeks ago i stumbled upon some even tastier free ware called Gadwin Screen Printer. You simply press print screen and gadwin takes care of the rest. it has simple options to save and the likes, easy to operate, and comes in handy if your soloing a 40 man instance and want to take pictures:D. Check it out HERE.

Number 4: I said 3 in the tittle? Oh…well I’m a liar. And this ones not near as long as the rest…Anyway! Our very own Bentun Stull recently started up a web comic that resembles Ctr-Alt-Del everyones favorite web comic right?…right? Guess not. Anyway, you should all swing over to his site www.eagleonefoxtwo.com the comics aren’t half bad and i’m sure he would like the support.

Additionally, here is a picture of a panda eating a small child. Or Bamboo, what ever you think.

And here we have what seems to be JT and Shanes last case of Crabs.

Until someone else derides to post. This has been a good waister of an hour of my time. Over and out..

Gerg Jew

posted by Gerg Jew at 11:41 pm  

Wakoopa : Track your software!

Monday, July 9, 2007

I was looking through Smashing Magazine’s “Best Of” for May/June today and found Wakoopa.

I’m not really sure how useful it is, but it’s cool anyway.   Wakoopa’s a little program(~800kb) that runs in the background, tracking what programs you use and how long you use them for.   Kind of like what Xfire does for PC games.

There’s a PC and a MAC version right now.  Supposedly a Linux version is on the way.

Go sign up and add me as a contact.

posted by johntash at 4:24 pm  

Gaim == Pidgin

Tuesday, April 10, 2007

I stumbled on this today. Apparently the multi-service and multi-platform im client Gaim changed it’s name to Pidgin a few days ago. They’ve been having legal troubles with AOL since they patented AIM.

It’s still the same program, but now the developers are going to start releasing real versions and not just beta versions. Their new web page is http://www.pidgin.im/

“After a long, and unfortunately secret debate (as we could not say why we were looking at a name change, we ended up just doing this ourselves), we settled on the name “Pidgin” for gaim itself, “libpurple” for libgaim (which, as of 2.0.0 beta6, exists), and “Finch” for gaim-text.”

Source: http://www.pidgin.im/ or http://gaim.sf.net

[tags]gaim,instant messaging,aim,aol,legal,software,freeware,stumbleupon,im,pidgin,linux,windows,opensource,open-source,open source[/tags]

posted by johntash at 12:39 am  

Update Your Software Automatically (On Windows)

Wednesday, April 4, 2007

Update:  FileHippo now includes an installer for their update checker program and the filesize is ~150kb.    Direct link to stand alone version is still available:  http://filehippo.com/updatechecker/UpdateChecker.exe

Part of the post that wordpress screwed me out of, was this software updater I saw at Google Operating System from FileHippo.

It’s kind of like `emerge -nupDv world` or `apt-get upgrade` but for windows, where there is no central repository for software. You download the 108kb exe 154kb exe with installer from filehippo and it’ll automatically scan your harddrive for software you have installed, send it to filehippo and then output a page similar to below showing you what software is out-dated with links where you should download the updated version.


This is only going to work with software that FileHippo knows about and can find, but it’s still pretty useful if you like keeping your system up to date.

The next best thing I know of for windows is Google’s Google Pack.

posted by johntash at 3:26 pm  

WordPress 2.1.3

Wednesday, April 4, 2007

I just updated WordPress to 2.1.3, and it looks like it went smoothly. Dreamhost has a neat one-click-install system that works pretty well; I haven’t had any trouble with it yet. I clicked upgrade and it sent me an email in a few minutes letting me know it was complete.

Also, if you click the Dreamhost link above and enter the referral code THESH17 then you’ll get $90 off your bill and we’ll get $7 for referring you.


posted by johntash at 1:42 pm  

Direct X 9.0c released

Wednesday, April 4, 2007

Direct X 9.0c Apr. 7 was released the other day. Download it here.

edit: Somehow the date on this post got set to May 7th instead of April.  My bad.

[tags]direct x, downloads, freeware, windows, software[/tags]

posted by johntash at 11:35 am  
Next Page »

39 queries. 0.152 seconds.
Copyright © 2007-2010 http://www.thesh17.com