# Listing 1. Excerpt from WLBS.pl
foreach my $counter (1..$frequency) {
# For each URL in the @urllist array, run a test.
my $ua = new LWP::UserAgent;
foreach my $url (@urllist) {
my $request = new HTTP::Request('GET', $url);
my $response = $ua->request($request);
# If the response is successful, take no action.
if ($response->is_success) {
print "$url online\n";
} else {
# If the response is unsuccessful, run the WLBS disable
# command to take the server out of the WLBS cluster.
print "$url offline\n";
system("wlbs disable 80");
# Add any other actions you want to take
# place in the event of a Web server failure.
}