используй параметр %2
				
			This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
[18-Dec-2007 11:26:59] Subagent "/usr/local/lib/libnsm_ping.so" loaded successfullyif echo $1 | nc -w $2  $3 $4 2>&- | grep -q $5; then echo 1; else echo 0; fi#!/usr/local/bin/perl
# Service Poller
use strict;
use IO::Socket::INET;
die "usage: ./service_poller.pl <request> <timeout> <host> <port> <response>" unless $ARGV[0];
die "usage: ./service_poller.pl <request> <timeout> <host> <port> <response>" unless $ARGV[1];
die "usage: ./service_poller.pl <request> <timeout> <host> <port> <response>" unless $ARGV[2];
die "usage: ./service_poller.pl <request> <timeout> <host> <port> <response>" unless $ARGV[3];
die "usage: ./service_poller.pl <request> <timeout> <host> <port> <response>" unless $ARGV[4];
my $recive_response = "";
my $request=$ARGV[0];
my $timeout=$ARGV[1];
my $host=$ARGV[2];
my $port=$ARGV[3];
my $response=$ARGV[4];
my $sock = new
IO::Socket::INET(
PeerAddr=>$host,
PeerPort=>$port,
Proto=>'tcp',
#LocalAddr => 'localhost',
#LocalPort => 27005,
#Broadcast => 1
Timeout=>$timeout);
#die "Could not create socket: $!\n" unless $sock;
die "0\n" unless $sock;
$sock->autoflush(1);
syswrite $sock, $request."\n";
sysread $sock,$recive_response,65535;
#chomp($recive_response);
#chop($recive_response);
#print $recive_response;
if($recive_response =~ /$response/) {
print "1"."\n";
} else {
print "0"."\n";
}
close $sock;