Glenn Kelley on 19 Jun 2008 20:15:54 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Load killer ?


I am wondering if anyone can help me here...
Don't know python - but perhaps that would help...

in short we want to measure httpd

when this service goes over say 6 on load
we want to kill it and restart

#!/usr/bin/perl -w
#use strict;
open(LOAD,"/proc/loadavg") || die "couldn't open /proc/loadavg: $!\n";
my @load=split(/ /,<LOAD>);
if ($load[0] > 9) {
`/sbin/service httpd restart`;

was my first attempt except of course - that will kill whenever any  
load happens

any suggestions...


Philadelphia Linux Users Group         --
Announcements -
General Discussion  --