chimni has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/bin/perl use strict; use warnings; use Parallel::ForkManager; my $pm = new Parallel::ForkManager(20); foreach my $ip (0..255) { my $ip_add = sprintf("202.1.150.%s",$ip); #print $ip_add; my $pid = $pm->start and next; my @val = `nmap -sT $ip_add | grep http`; #print @val; if (@val) { foreach (@val) { my $test = (split(/\s+/,$_))[1]; if ($test =~ m/open/) { print "Web Server at $ip_add is runnin +g.\n"; last; } } } else { print "Web Server at $ip_add is Down.\n"; } $pm->finish; } $pm->wait_all_children; exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Monitor webserver status on all machines in a subnet
by Abigail-II (Bishop) on May 27, 2004 at 11:21 UTC | |
|
Re: Monitor webserver status in a subnet
by borisz (Canon) on May 27, 2004 at 10:53 UTC | |
|
Re: Monitor webserver status on all machines in a subnet
by cLive ;-) (Prior) on May 27, 2004 at 11:18 UTC | |
|
Re: Monitor webserver status on all machines in a subnet
by Chady (Priest) on May 27, 2004 at 13:00 UTC |