Pop up dialog box on remote computers

I need to send out messages to over 100 clients in my sector. I want it to pop up a dialog box letting them know to save work and log out. I have the reboot script created just need the warning please. Thanks

What terminals, user interfaces, or client programs are they using?

What work would they have open?

There are many commands like wall, write, and talk. Wall is the default command use to send broadcast message to unix user.

The software that they are using is military software. Thanks i was unsure if there was something else besides wall to use. if i use wall will that show a pop up box?

That tells us nothing.

Popup a box on what?

Wall just writes a message to logged on terminals.

ok sorry to be more specific. I am running solaris 9 on sunblade 1500. I need a pop up box with an ok radial on it like on windows that states the system is going down when a system amdinistrator sends the shutdown command to the remote box. the software that the operators are using has no part in this dialog box. I want solaris 9 OS to handle the dialog box. does that make sense a little bit? if not sorry

ie.
This System will be going down for maintenance in 30 seconds please save all work and press ok.

Are the clients using X-terminals?

yes they are.

Do they all login using CDE or Gnome, or are they running the program by some other means to get it on their screen?

Basically, how are you going to know who to send the messages to and which screens?

Are you then going to require a confirmation from each person or are you going to shutdown the server in the time period anyway?

If you want to open an x-window on a remote machine uninvited, it's generally non-trivial.

If the users are not using Xauth security (eg MIT magic cookies etc) then it's not _too_ hard to determine the display to send to and fire a window at it.

This 'military software'; does it run with the display name (ie <hostname>:<display number>) in the commandline or do they rely on a $DISPLAY environment variable?
For that matter, does it even use X or is it run within a terminal session via X?

It's totally doable, but there are a lot of factors that will determine how to go about it.

High-level approach:
Produce a list of users to warn (probably from 'ps' or 'who' output)
Identify the X server they are connecting from
Obtain a copy of appropriate authorisation to send something to their X server
Send the message, taking care not to present them with an app that has elevated privilages.
Log the response to the message (if you need to).

CDE to login. yes we have a built in program that can run locally on the machine to show the pop up box. the dialog box no matter if they click ok or not does not dictate the reboot, it is more of a warning of what i am about to do.

this is what i have used in the past but i think i am missing some variables.

rsh test004 `cd /h/test/bin`; DISPLAY=0.0; export DISPLAY; ./Msg "message here";&

but it keeps outputting the pop up box on my local box not the remote machines.

hostname is in the terminal window when you open it

now the thing that is different is that the host name will be a variable from a list so it would be more like rsh test0${x}
list="01 02 03 04 05 06"
for x in $list ; do
echo $x
then the command will be here

When the user logins in you want to kick off a program that sits silently waiting for a message to be displayed.

This will effectively capture the user's DISPLAY and authority. It needs to wait on some IPC mechanism. When it gets triggered, it can then run your "display a dialog message" program with the correct context and environment.

When the user logs out this process needs to be cleaned up.

One way of knowing when client has gone is to have a program create a hidden window as the child of the root. When the X session dies you could capture the X error back. This would require some Xlib programming.

see the process for that program is launched already it is a child to other process that are running on the system for other functions. All i need to do is run the program and a dialog box will show up. i guess what i really need is a rsh to execute that program on every client and export the display locally to each machine with the message

As an aside and for comparison, the way this works on Windows is it has a "Messenger" service that is sitting waiting for messages on the LAN. This is woken up by messages sent with "net send".

The above command has the end quote in the wrong place to execute the export command on test004.
Try moving it to the end of the line?

Edit:

Also, if you can open it on display 0 just by logging in over there - why not open it remotely? (ie DISPLAY=test004:0 ; export DISPLAY ; Msg "message here" &)

see that is what i was looking for something like what you posted. thanks i will give that a try

ok this is what i have this far
#!/bin/sh
LAST=`/etc/hosts | awk '{print $1}'`
for x in $LAST ; do
rsh ${x} `cd /h/test/bin`; DISPLAY=test004:0; export DISPLAY; Msg "message here" &

this is what is am getting now

sh: DISPLAY=test004:0.0: is not an identifier

what does that mean
this is what i did

list="01 02 03 04"
for x in $list ; do
echo $x
rsh test0${x} export DISPLAY=test0${x}:0.0
rsh test0${x} /h/test/Msg "test test"
done

and it returns the line above with that error

You do realise the "rsh" has run to separate shells?

wouldn't the following be better?

for x in $list
do
         echo $x
         rsh test0${x} <<EOF
DISPLAY=test0${x}:0.0 /h/test/Msg "test test"
EOF
done

also you are assuming the screen is 0.0.