If you are not a root user, or the code is not run by the web server as a
user with high enough privileges, it may not be able to open a socket on the
system...

Mind you, apache does not run as root, so that could be a problem...

-----Original Message-----
From: Kristofer Wolff [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 11, 2001 9:11 AM
To: [EMAIL PROTECTED]; perllist
Subject: AW: check if a FTP server online


its on other box.

-----Ursprüngliche Nachricht-----
Von: Bill "vuud" Chmura [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 11. Juni 2001 03:26
An: 'Kristofer Wolff'
Betreff: RE: check if a FTP server online



When you say that on the web it does not work, is that on another server? Or
the same box?




-----Original Message-----
From: Kristofer Wolff [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 10, 2001 1:40 PM
To: [EMAIL PROTECTED]; perllist
Subject: AW: check if a FTP server online


Thanx Bill,

i made a test with e shell script in perl to testing the ftp server via a
socket connektion: ist very quick and clean ( my opinion ):
------------------------------------------------------------ script:
                #/ drives
                        $drivelist =  "<table border=\"0\">";
                        foreach(keys %FTPDRIVES)
                        {
                                ($ftp_name, $ftp_description, $ftp_server, $ftp_login, 
$ftp_pass,
$ftp_mode, $ftp_dir)=split(/\t/, $FTPDRIVES{$_});
                                #// ping drive
                                if(open_TCP(F, "$ftp_server", 21) == undef)
                                {       #--> ping error
                                        $drivelist .=  "ERROR<tr><td><a
href=\"javascript:openFTP(".$_.");\"><img src=
\"$pic_dir"."/ftperror.gif\"
border=\"0\"></a></td></tr><tr><td>$ftp_name</td></tr>";
                                }
                                else
                                {       #--> ping ok
                                        $drivelist .=  "<tr><td><a 
href=\"javascript:openFTP(".$_.");\"><img
src=\"$pic_dir"."/ftpok.gif\"
border=\"0\"></a></td></tr><tr><td>$ftp_name</td></tr>";
                                }
                        }
                        $drivelist .=  "</table>";
                        $deskTEPL =~ s/<!--drives-->/$drivelist/g;
sub open_TCP
{
        my($FS, $dest, $port) = @_;
        my $proto = getprotobyname('tcp');
        socket($FS, PF_INET, SOCK_STREAM, $proto);
        my $sin = sockaddr_in($port, inet_aton($dest));
        connect($FS, $sin) || return undef;
        my $old_fh = select($FS);
        $| = 1;
        select($old_fh);
        1;
}
------------------------------------------------------------
So, if a ftp server is on, the script printas out a ok sign, or of not a
other sign !

on the Dos.Shel it works fine !!! But in the Web, it always prints the ok,
sign !  ! ! pretty shitty !

you thougt ?

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von
Bill "vuud" Chmura
Gesendet: Sonntag, 10. Juni 2001 17:21
An: 'Kristofer Wolff'; 'perllist'
Betreff: RE: check if a FTP server online



It depends on what you want to check -

Ping / Net Ping will tell you if the machine itself is on, but not if the
FTP service is active...

DNS - I am not sure what you mean with this one...

Login Test - This will tell you if the FTP service is responding.  I am not
sure I would actually have it login, but you should establish a connection
without sending any username / password.  I am not sure Net::FTP will let
you do this, but a telnet to the FTP port should tell you.





-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Kristofer Wolff
Sent: Friday, June 08, 2001 10:30 PM
To: perllist
Subject: check if a FTP server online


Hi folks,

what do you think is the fastest way to check out if a ftp server available
or not ? ping ? net::ping ?? or DNS ?? or a login test ?



_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to