Does anyone know of a GPL script or how I would go about creating a script that checks the current server load on a Linux/Apache webserver

Basically I am trying to modify a GPL Perl backup script like this pseudo-code

if ( ServerLoad < 15% ) {

DoSomething();

}
else
{

DoNothing();

}