Just some more info: If I use the orignal Socket library and build the
connection by hand, it behaves as normal:

#!/usr/local/bin/perl -w

use Socket;


$remote_host    = "85.3.25.115";
$remote_port    = "25";

socket(TO_SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp'));

$internet_addr = inet_aton($remote_host) or die "Could not convert
$remote_host into an internet address: $!\n";
$paddr = sockaddr_in($remote_port, $internet_addr);

connect(TO_SERVER, $paddr) or die "Could not connect to
$remote_host:$remote_port : $!\n";

print TO_SERVER "HELO\n";

close(TO_SERVER);

???

-Chuck


---
Chuck Carson
Clinicomp International
Sr. Systems Engineer
San Diego, California
O: +1 (858) 646-2095
F: +1 (858) 297-8570



-----Original Message-----
From: James Kelty [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 28, 2001 10:14 AM
To: perl-cgi
Subject: RE: Perl script to monitor sendmail


#!/usr/bin/perl -w
use IO::Socket::INET;
my $sock = IO::Socket::INET->new(PeerAdd   => "hostname",
                                 PeerPort  => "smtp(25)",
                                 Proto     => "tcp",
                                 Timeout   => "Something Reasonable like
5
or 10");
print "System down" unless $sock;


-James


-----Original Message-----
From: perl-cgi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 9:41 AM
To: [EMAIL PROTECTED]
Subject: Perl script to monitor sendmail



We are using a Windows based SMTP virus scanner that scans port 25 and
then forwards to are real mail server which is SuSE based. This damn
software product keeps crashing and there is no way to know when it
crashes unless you login with PC Anywhere and do the GUI thing. Can
anyone share some sample code that would allow a perl script hosted on a
Unix machine periodically connect to the mail port and determine if it
is up or not.

Thanks,
CC



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to