*** my first email seems to have been truncated ******

This is the batch file I use to check that anonymous logins are working on our 
FTP server. 
  You could change it so it logs in as a specific user or uploads/downloads a 
file.

The "ftp_check.bat" attached is the batch file.  It uses the windows command 
line ftp 
program to auto login to the server and record the output to a log file.  We 
then use the 
"find" command to parse the log file and look for the expected output. You will 
need to 
edit this file to check for the correct return text from a login to your FTP 
server.

The "ftp_login.txt" file is the ftp script used by the batch file.  It contains 
the 
hostname of the ftp server, the account/password of the user to login as.

Setup an "External (errorlevel)" check to run the batch script and detect a 
DOWN if the 
result "is > than 0"

Trevor


############# BEGIN: ftp_check.bat ######################
:: Auto login FTP script
:: Used to test if the FTP server is allowing logins

:: Turn off echo output
@echo off

:: Make sure we are in the correct directory
c:
cd c:\scripts

:: Delete the old log files from previous runs
del error.log
del quiet_output.txt

:: Run the command line ftp program
:: Use the login text file as input
:: Record all output including errors to the error.log file
ftp -n -s:ftplogin.txt > error.log 2>&1

:: Look for the required string in the error.log
:: Redirect the find command output so we don't see it
find "Anonymous access granted" error.log > quiet_output.txt

:: Grab the errorlevel from the find command and ouput it
:: so sysmon will see it
set ERRORLEV=%errorlevel%
echo %ERRORLEV%
exit %ERRORLEV%
############# END: ftp_check.bat ######################

############# BEGIN: ftp_login.txt ######################
open servername.example.com
user
anonymous
[EMAIL PROTECTED]
quit
############# END: ftp_login.txt ######################


Ahmed Hassan wrote:
> Thanks for the quick howto.
> Is there a way to get SA to login to the ftp server? If yes how do I set it 
> up.
> 
> ----- Original Message ----
> From: Dirk <[EMAIL PROTECTED]>
> To: Servers Alive Discussion List <[email protected]>
> Sent: Wednesday, 17 September, 2008 11:55:14
> Subject: RE: [SA-list] FTP Check
> 
> 
> 
> If the port is up, and the correct message is send back to the user then SA 
> will flag it as being up and in most cases the user will be able to enter 
> his/her username.   
> 
> (which is NOT the same as being able to login to the FTP server). 
> 
>    
> 
> How to setup: 
> 
>                 create new entry 
> 
>                 enter the hostname/IP of the FTP server 
> 
>                 on the CHECK tab select TCP protocol 
> 
>                                 in the listbox below that select FTP 
> 
> that's it… 
> 
>    
> 
>    
> 
> Dirk Bulinckx.  
> 
> From: Servers Alive Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of 
> Ahmed Hassan
> Sent: Wednesday, September 17, 2008 12:40 PM
> To: Servers Alive Discussion List
> Subject: Re: [SA-list] FTP Check 
> 
>    
> 
> Thanks Dirk.
> 
> So does it mean that if the port connection is UP (OK)  then the server 
> should accept connections from users?
> So how do I set this check up? 
> 
> 
>    
> 
> ----- Original Message ----
> From: Dirk <[EMAIL PROTECTED]>
> To: Servers Alive Discussion List <[email protected]>
> Sent: Wednesday, 17 September, 2008 11:30:12
> Subject: RE: [SA-list] FTP Check 
> 
> The TCP-TFP check will connect to the FTP server (port connection) and see if 
> it does get the normal first "message " from the FTP server (being a response 
> that starts with 220) 
> 
>   
> 
>   
> 
>   
> 
> Dirk Bulinckx.  
> 
> From: Servers Alive Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of 
> Ahmed Hassan
> Sent: Wednesday, September 17, 2008 11:45 AM
> To: Servers Alive Discussion List
> Subject: [SA-list] FTP Check 
> 
>   
> 
> Hello
> 
> Is anyone using SA to monitor to an ftp server? I have an ftp server (titan) 
> which sometimes refuses connections from users and was wondering whether I 
> can use SA to monitor it.
> 
> If yes can you please let me know how to set it up.
> 
> Thanks 
> 
> 
> 
> 
> To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
> [email protected]
> If you use auto-responders (like out-of-the-office messages), make sure that 
> they are not sent to the list nor to individual members. Doing so will cause 
> you to be automatically removed from the list. 
> 
> 
> 
> To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
> [email protected]
> If you use auto-responders (like out-of-the-office messages), make sure that 
> they are not sent to the list nor to individual members. Doing so will cause 
> you to be automatically removed from the list. 
> 
> 
> 
> 
> To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
> [email protected]
> If you use auto-responders (like out-of-the-office messages), make sure that 
> they are not sent to the list nor to individual members. Doing so will cause 
> you to be automatically removed from the list. 
> 
> To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
> [email protected]
> If you use auto-responders (like out-of-the-office messages), make sure that 
> they are not sent to the list nor to individual members. Doing so will cause 
> you to be automatically removed from the list.
> 
> 
> To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
> [email protected]
> If you use auto-responders (like out-of-the-office messages), make sure that 
> they are not sent to the list nor to individual members. Doing so will cause 
> you to be automatically removed from the list.
> 

To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
[email protected]
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members.  Doing so will cause 
you to be automatically removed from the list.

Reply via email to