... # $addr is the actual subnet, e.g. "192.168.1.0" ... my $output = qx{nmap -sP ${addr}/24}; my @nodes= $output =~ /(?<=\s)c\w+\b/g; #### ... print header('text/html'); print h1('Local Network: '. $addr . '/24'); print map "$_ appears to be up
", @hosts ... ##
## ... my ($exe, $cmd) = ('/usr/bin/rsh', 'ps -fl r -u username'); my $cnt = 0; for my $node ( sort @nodes ) { my @res = grep !(/$cmd/ || /STIME/), split /[\n\r]+/, qx{$exe $node $cmd}; my $nproc = scalar @res; # how many processes if( $nproc ) { print map "Do " . "some ". "formatting of " . "ps -fl output here!", @res } ... ++$cnt ...