Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Broadcast or $BRDCST

SOLVED
Go to solution
sathya prabu
Advisor

Broadcast or $BRDCST

Can i log all the broadcast(basiclly REPLY) messages into a file.
4 REPLIES
sathya prabu
Advisor

Re: Broadcast or $BRDCST

Disabling the reply message to display on the terminal using SET BROADCAST=NOGENERAL, when switched on back SET BROADCAST=ALL also is not displaying any messages arrived during the session. Does anybody have any idea on how to have a track on the REPLY messages?
Joseph Huber_1
Honored Contributor
Solution

Re: Broadcast or $BRDCST

Your question is somewhat ambigous:

Broadcast to Your process/terminal can be catched by a program establishing an attention-mailbox-AST on the terminal (sys$input) of the process.
An example of how to do it is in
http://www.mpp.mpg.de/~huber/vmssig/src/MAR/GRAB_BROADCAST_MESSAGES.MAR

You can take this program, and enhance it to log the trapped messages to a file.

Or take another example written in C, which traps broadcasts and displays them in graphic display window:

http://www.mpp.mpg.de/~huber/vmssig/src/C/BTRAP.C


On the other hand "REPLY" messages ? OPCOM messages are logged in the OPERATOR log file if enabled by REPLY/LOG.

http://www.mpp.mpg.de/~huber
John Gillings
Honored Contributor

Re: Broadcast or $BRDCST

sathya,

In theory you could put a software hook in the system service dispatch vector for the $BRDCST service and log everything that went past for all users and all destinations. A non-trivial, privileged, and fairly dangerous exercise. If you need to ask this question, then it's probably not something you should attempt straight away.

Remember that $BRDCST (REPLY) messages can be sent FROM anywhere, and TO a variety of destinations. Think about which messages you're interested in, and if you want to catch them on the sending side or the receiving side. There are numerous tricky cases. For example, what if someone sends a REPLY/USER=someone but the user isn't logged in? The message never gets delivered anywhere. What if someone sends a message to a specific terminal with no one logged in? The message is delivered, but there's no attached process to catch it with something like Joseph's example program.

If you have control over the sending of the messages you're interested in, I'd be taking the easy solution of logging at the source. Abstract the operation, changing it in your sending application from "$BRDCST" to "SendMessage". Implement SendMessage as:

LogMessage(msg)
$BRDCST(msg)

(where LogMessage writes the message to your log file).
A crucible of informative mistakes
sathya prabu
Advisor

Re: Broadcast or $BRDCST

Thanks a lot John and Joseph! that definitely helped me.