|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Greetings
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>);
close(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...
glenn
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|