- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to get the status of a FTP command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2006 06:18 PM
09-14-2006 06:18 PM
How to get the status of a FTP command
I have just joined this forum and am a novice to this field, therefore any help on this would be greatly appreciated.
My requirement is that I need to capture the success/failure of an FTP operation into a variable in a command procedure. Typically if the FTP address that I am requesting is not available.
The $status and $severity variables are always showing as normal even if the ftp address is not available and FTP has timed out. I even tried using the spawn command to capture the status, but the same hasn't worked. Please help
Code example :
----------------------------------------------
$ ftp xxx.xxx.xxx.xxx
XXX.XXX.XXX.XXX: %MULTINET-F-ETIMEDOUT, Connection timed out
ftp>spawn
$ status = f$message ($status)
$ sho symbol status
STATUS = "%NONAME-W-NOMSG, Message number 00000000"
$ severity = $severity
$ show symbol severity
SEVERITY = "1"
$ log off
FTP> exit
$ status = f$message ($status)
$ show symbol status
STATUS = "%SYSTEM-S-NORMAL, normal successful completion"
$ severity = $severity
$ show symbol severity
SEVERITY = "1"
----------------------------------------------
Even though the ftp has timed out as the server was not available, the staus was normal completion. How to capture the correct status.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2006 06:44 PM
09-14-2006 06:44 PM
Re: How to get the status of a FTP command
OpenVMS only returns the EXIT status of an image into the DCL $STATUS symbol. If you spawn a subprocess, your main image does not exit, so you can't see it's status value.
Depending on your OpenVMS version and your TCPIP stack, you can execute some FTP commands using their OpenVMS equivalent DCL commands, e.g.:
$ DIR/FTP or $ COPY/FTP
These command would then return at least success/failure status.
Another way may be to write a little DCL command file with FTP commands and run this mini-procedure with SYS$OUTPUT assigned to a temp file, then parse the temp file for FTP status/errors.
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2006 06:57 PM
09-14-2006 06:57 PM
Re: How to get the status of a FTP command
_TNA6:tcpip show ver
Compaq TCP/IP Services for OpenVMS Alpha Version V5.1 - ECO 1
on a AlphaStation 200 4/166 running OpenVMS V7.2-1
_TNA6:ftp xxxxxxxxx.xxx
%TCPIP-E-FTP_NETERR, I/O error on network device
-TCPIP-W-TRY_AGAIN, name server experienced temporary error, retry operation
_TNA6:sts=$status
_TNA6:show sym sts
STS = "%X17649ABA"
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2006 06:58 PM
09-14-2006 06:58 PM
Re: How to get the status of a FTP command
ftp does return status info.
I use following procedure:
$on warning then goto error_proc
$FTP ftp_server_name
username
Password
PUT ...
EXIT
$ ... everything went OK
$EXIT
$error_proc:
$IF ($STATUS .EQS. "%X17649AAA") .OR. ($STATUS .EQS. "%X17649ABA")
$THEN
$ ... login or connection error
$ELSE
$ ... some other error like file or directory problem
$ENDIF
$EXIT
Rgds
Marc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2006 09:08 PM
09-14-2006 09:08 PM
Re: How to get the status of a FTP command
suggested. Also, if you're always fetching
files instead of sending them, then a
program like wget or curl might be useful.
http://antinode.org/dec/sw/wget.html
http://curl.haxx.se/
There exists a program called wput (for
sending files), but I haven't looked at it
for a long while, and with COPY /FTP, there's
not much need for it on VMS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2006 12:43 AM
09-15-2006 12:43 AM
Re: How to get the status of a FTP command
The COPY/FTP command, or
ftp hostname put foo
will exit with a failure status as desired.
If there is a desire to do many FTP commands, then I would recommend that the /TAKE_FILE qualifier be used and that the file include "EXIT-ON-ERROR" as the first command. This will cause FTP to exit due to the error in connecting. If you desire to ignore errors after the connect, then another "EXIT-ON-ERROR" command will turn off this functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2006 06:10 AM
09-15-2006 06:10 AM
Re: How to get the status of a FTP command
I have tried the examples given, however for some reason I did not get a STATUS = "%X17649AAA" OR STATUS = "%X17649ABA". I have written a command procedure as suggested:
--------------------------------------------
$ SET ON
$on warning then goto error_proc
$FTP ftp_server_name/user="username"/pass="Password"
EXIT
$ write sys$output "Job completed successfully"
$EXIT
$error_proc:
$IF ($STATUS .EQS. "%X17649AAA") .OR. ($STATUS .EQS. "%X17649ABA")
$THEN
$ write sys$output "login or connection error"
$ELSE
$ Write sys$output "some other error like file or directory problem"
$ENDIF
$EXIT
I had given the FTP details with the wrong password. The FTP prompt showed an error saying invalid login information but the command proc ended showing job completed successfully.
One question, has this got to do with the version of the Multinet FTP that is running on my server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2006 10:18 AM
09-17-2006 10:18 AM
Re: How to get the status of a FTP command
$ ftp 192.168.0.5 /username="test" /password="secret"/input=ftp.com
$ if .not. $severity .AND. 1 !not successful
Many times the input file contains variable data. Create the input file at runtime and delete at completion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2006 11:01 AM
09-17-2006 11:01 AM
Re: How to get the status of a FTP command
tests that bit. For example:
alp $ if 0 then write sys$output "True"
alp $ if 1 then write sys$output "True"
True
alp $ if 2 then write sys$output "True"
alp $ if 3 then write sys$output "True"
True
[...]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 02:46 AM
09-18-2006 02:46 AM
Re: How to get the status of a FTP command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 02:58 AM
09-18-2006 02:58 AM
Re: How to get the status of a FTP command
I just did a test connect (to a node that I knew was down) and got %X100081E4 for a status. When I used a bad password I got %x1212002c.
This was all done with specifying the username and password on the command line with a /take_file and the take_file containing the EXIT-ON-ERROR, CONNECT and other commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 02:26 AM
09-29-2006 02:26 AM
Re: How to get the status of a FTP command
Thanks a Lot for all the support.
Regards,
Pallavi