When I use Spong( a monitoring package for services), I get the following
messages in my syslog everytime
Spong checks to see if the service is open:

Did not receive identification string from xxx.xxx.xxx.xxx.

The question I have is, what is a good way to keep this from happening?
Switch the loglevel to warn rather than info? 
Here is the perl script I used to duplicate this error. It is taken from the
spong source:
<PerlCode>
#!/bin/perl
use warnings;
use Sys::Hostname;
use Socket;
use IO::Socket;

$line="";
$ip="127.0.0.1";
$port=998;
$proto="tcp";
$iaddr = inet_aton( $ip )                    || return -1;
$paddr = sockaddr_in( $port, $iaddr );
$timeout=10;


local $SIG{'ALRM'} = sub { die "Socket timed out"; };
alarm($timeout);
socket( SOCK, PF_INET, SOCK_STREAM, $proto ) || die "socket: $!";
connect( SOCK, $paddr )                      || die "connect: $!";
select((select(SOCK), $| = 1)[0]);
print SOCK "$data";
recv( SOCK, $line, 256, 0 );  # just grab a chunk from the service.
alarm(0);
close( SOCK ) || die "close: $!";
</PerlCode
-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-796-9023
email: [EMAIL PROTECTED] 

Reply via email to