|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Net::FTP Trouble - Beg for help~
Hello, I am having a hard time trying to get a part of my script working. This script checks the availability of services. The mysql check below works great, but the FTP check does not. Any help would be greatly appreciated.
THIS WORKS: use DBI; # MySQL Check $dbh = DBI->connect("DBI:mysql:jdarow_monitor:localhost","db_name","mypasswd"); if ($dbh){$mysqlstatus = 1;} ### ( $mysqlstatus = 1 if mysql down ) THIS I CANNOT GET WORKING: use Net::FTP; # FTP Check $ftp = Net::FTP->new($ftphostname); $ftplchk = 'ftp->login($ftpusername, $ftppassword)'; if ($ftplchk){$ftpstatus = 1;} ### ( $ftpstatus should = 1 if ftp down ) Thanks to all that respond, I really appreciate it too! Last edited by jdarow : March 11th, 2004 at 05:06 PM. |
|
#2
|
|||
|
|||
|
Here was another attempt:
$ftp = Net::FTP->new("1.1.1.1"); $ftplchk = $ftp->login("jdarow", "mypasswd"); if ($ftplchk){$ftpstatus = 1;} |
|
#3
|
||||
|
||||
|
Could you not just use the typical error handling for the connection check?
$ftp = Net::FTP->new("$server") || die "$server unreachable\n"; $ftp->login($user, $cred) || die "Login fails for $user\n"; $ftp->quit(); |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Net::FTP Trouble - Beg for help~ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|