#!/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] > 5) {
`/sbin/service httpd restart`;
}
and placed it in /usr/local/script/loadavg.pl and chmod to 755
and added this to my crontab
*/1 * * * * root /usr/local/script/loadavg.pl
my server load went up to 20 and waited if it will automatically go down via the script but it seems it's not working. I had to restart apache manually.
Can anyone tell me what I'm doing wrong with the script?
Thanks in advance.
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12344
Posted:
Thu Jan 25, 2007 10:38 pm
I don't know what this does. It doesn't seem to be a GoogleTap or phpNuke issue
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum