Operating System - OpenVMS
1820213 Members
3816 Online
109620 Solutions
New Discussion юеВ

Re: Setup E-mail notification in VMS system

 
SOLVED
Go to solution
Jorge Cocomess
Super Advisor

Setup E-mail notification in VMS system

Hi,

Not sure where I should start, but I am going to try anyway, please bare with me on this. I have this daily FTP process that runs on the Wintel server. What I would like to do is to send an e-mail notification once the FTP process is completed. I do know how to create the an e-mail distribution file with bunch of e-mails names in this file on the VMS server, but not sure how I can evoke to send out this distribution file.

Is there an easier method to do this? Any ideas where I can look for examples?

Thank you in adavnce.

Jorge
11 REPLIES 11
Hoff
Honored Contributor
Solution

Re: Setup E-mail notification in VMS system

I'm assuming here that the FTP portion of this discussion is not directly relevant to the question at hand; that you're looking for details of sending out an existing file to an existing distribution list. If so, the usual DCL command is:

$ mail msgfile.txt -
"@distrolist.dis" -
/subject="subject"

See HELP MAIL for command details.

It's also feasible to use existing networking tools such as ssh and rsh and rexec to trigger a command or a procedure on the remote host; to invoke an action on the remote host. This avoids processing mail.

There are fancier ways.

Stephen Hoffman
HoffmanLabs LLC
Jorge Cocomess
Super Advisor

Re: Setup E-mail notification in VMS system

How would I invoke the email notification if the process execute on the remote server? It would much easier if the FTP process execute off the VMS server.

Hein van den Heuvel
Honored Contributor

Re: Setup E-mail notification in VMS system

- Which system should be a driver?
- Is there special contents / data for the Email which is only available on one of the systems?
- Do you have unlimited privs on either side?
- What tools are at your disposal (DCL? Perl? C?...)

It sounds like the windows box is the driver, in that is originates / triggers the transfer.
Thus it is probably also the best system to send the Email as client software can probably be scripted more easily.
Allthough I admittedly neven looked for one, surely there are plently Email (commandline) tools on windoze. For sure there are Email modules for Perl, and I have sendmail in cygwin on my windoze system.

On the VMS, receiving / server, side there would seem to be 2 choices.

1) Hook something up to the ftp_server script. For example in the multinet script that would be just after $MultiNet FTP/Server. It could test after that exits.
2) Polling.

What is known about the incoming file?
a) probably the same username all the time?
b) similar time every day? Frequency
c) predictable/recognizable destination?
d) predictable/recognizable filename
e) anticipated size?
f) with waht granularity/precision is the Email required? Within 1 second? 10 seconds? 10 minutes? 1 hours?

You could use any or all of the above to check for a file, and its creation/modify date, and its EOF (not being 0).

Maybe it is good enough to have a self submitting batch job once a day check every 10 minutes for an hour and send an succes/failure Email when found or not.

Maybe you have a 'cron' style scheduler on the system where you can plug in a check every minute for a small cost?

Maybe the login.com for the account can be tweaked to figure out that an FTP Network connection is coming in and start a polling process for the file transfer to finish.

For example, I just coded up something very simple in my login.com
$ if f$mode().nes."NETWORK" then exit
$ open/read/write/share=write x network.lock
$ read x record
$ exit

Now I could submit a job, or run a (detached) process to try get that record. When I get it, the network login is done and I can check for the file

Note: too bad we did (not yet) get a $READ/WAIT in DCL in addition to the /TIME_OUT to wait for a record lock. It would take no code at all, just flip the WAT bit in the RMS RAB for the file!

The more you know about the problem, the better you can make the solution, where better may mean performance, timeliness or both.

Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting

Anton van Ruitenbeek
Trusted Contributor

Re: Setup E-mail notification in VMS system

Jorge,

An other possibility is to do a rsh on OpenVMS.
Because of the FTP process you do have an username/password combination on OpenVMS.
When the FTP process is ready you can do as last in the FTP process a 'rsh' wich only do
$ mail [/nl:] @list /subject="ready FTP process"

AvR
NL: Meten is weten, maar je moet weten hoe te meten! - UK: Measuremets is knowledge, but you need to know how to measure !
Jorge Cocomess
Super Advisor

Re: Setup E-mail notification in VMS system

AVR,

I am not able to estabished a connection via rsh.

Thanks,
Jorge
Hoff
Honored Contributor

Re: Setup E-mail notification in VMS system

Hi Jorge,

Please indicate what platform is driving the file transfer: is the file transfer client operating on Windows or on OpenVMS?

Please also describe the sequence you have implemented now (at least as far as has been implemented), and the sequence of what you want to have happen here, and particularly what you want to have happen on each platform involved in the operation.

There was mention of FTP in the first message, and it was not clear (to me) how this fits into and how this sequences.
Jorge Cocomess
Super Advisor

Re: Setup E-mail notification in VMS system

Well, the FTP process triggers by a person on the Windows XP worskstation by clicking the icon on the desktop. Once the icon is pressed, it will than move a .txt file from a Windows 2003 server and FTP it to a VMS server.

All I would like to do is to drop an email to so and so letting them know that the .txt file has been dropped.

I guess, I could use the IIS SMTP protocol to send out the email, but I was hoping to use something more reliable like the VMS environment. I do have quite of VMS processing running now with email completion notification now, but not on the Windows box though.


Thanks,
Jorge
Hoff
Honored Contributor

Re: Setup E-mail notification in VMS system

Make the Windows box send the mail. The Windows box knows when the FTP transfer is completed, after all.

If you seek to use OpenVMS itself here, your alternative is to wire into the security alarms (documented, not easy), to periodically poll the directory (documented, easy -- save for dealing with the "in-flight case"; collisions between the polling and the FTP transfer), or you could wire into the directory lock processing (not easy, not documented) and capture the arrival of the file.

OpenVMS doesn't have a "doorbell" mechanism for files.

A complete alternative implementation is to code the trigger to to use OpenVMS, and have OpenVMS pull the file from (where-ever), where it can then (also) send the mail.

Or to send the file over via mail or such, and to use DELIVER to process the arriving message.

Or you can generate the file in a shared area that is visible to OpenVMS and Windows. This is typically in an NFS-served partition, as there is no SMB/CIFS *client* for OpenVMS.

Or you can take the easy way out, and code the Windows Server script/tool that performs the FTP transfer to (also) perform some other function secondary to the transfer; to trigger the notification via mail message, cURL, ping, homing pigeon, cans and string, r-command, or otherwise.
Jan van den Ende
Honored Contributor

Re: Setup E-mail notification in VMS system

Jorge,

the way we do something of similar kind.

You _DO_ need a didicated VMS account to which the FTP is sent, which is NOT used for anything that conflicts.

In that account's LOGIN.COM, if the F$MODE() is "INTERACTIVE", submit a batch job to run as soon as the FTP copy should be finished (eg: /AFTER="+0:5") to do (any required processing and) the MAIL sending.

It may or may not fit your requirements though....

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Jorge Cocomess
Super Advisor

Re: Setup E-mail notification in VMS system

Thanks guys!! I've decided to use the Windows SMTP protocol instead. I've created a canned email template will be dropped in the pickup folder right after the FTP script finished.

Again, thanks for all your help on this.

Jorge
Jorge Cocomess
Super Advisor

Re: Setup E-mail notification in VMS system

Found the answer.