FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 11th, 2004, 05:01 PM
jdarow jdarow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 jdarow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old March 11th, 2004, 05:05 PM
jdarow jdarow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 jdarow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here was another attempt:

$ftp = Net::FTP->new("1.1.1.1");
$ftplchk = $ftp->login("jdarow", "mypasswd");
if ($ftplchk){$ftpstatus = 1;}

Reply With Quote
  #3  
Old March 12th, 2004, 09:45 AM
ldap4u's Avatar
ldap4u ldap4u is offline
Chris Larivee
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Littleton, CO
Posts: 72 ldap4u User rank is Private First Class (20 - 50 Reputation Level)ldap4u User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 49 m 14 sec
Reputation Power: 5
Send a message via MSN to ldap4u
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();

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Net::FTP Trouble - Beg for help~


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway