Page 1 of 1 1
Topic Options
#181001 - 2007-10-01 03:52 PM Distributed net send type of app
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I need to write a tool that will distribute a text message to client PCs across the WAN.

Net Send (besides being unreliable) isn't pretty enough for the IT managers, so I have written up a client GUI app to display the message with color and logos.


I have also written an admin GUI that will allow the msg to be entered and to select via listview all the networks to receive the broadcast.


My problem is making the two apps communicate.
I have spawned a number of cmd processes to manage the ping process for looking for live IPs (about 20 class c networks)
 Code:
for each $subnet in $arrSubnets
run 'cmd /c wkix32.exe "'+@scriptdir+'"\pushmsg.kix $s=$subnet $m="$msg"'
next 


I considered just doing a file copy to a hidden/root share that the client will monitor, but that seems cumbersome... even a small ini file copied across to 1500 PCs will take a bit of time, even if I have 20 processes managing it.

I thought about using sockets in KF.NET, but I can't find any details on if sockets is even implemented in KF.NET, just in KF... and if it was old or ignored, as most posts about it are seveal years old.

Basically I need to send a few sentances... say 256 characters at most, with no logging or receipt needed as long as it is semi reliable.

It has to work to and from both XP and Vista and the message might be sent by staff without admin rights.

Suggestions?


Edited by Radimus (2007-10-01 10:04 PM)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#181002 - 2007-10-01 03:53 PM Re: Distributed net send type of app [Re: Radimus]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Shawn has written a client and server chat program (though plain and simple) so you can enhance that to use. I's for kixforms 2.x and you can find it on kixforms.com forums somewhere.
Top
#181016 - 2007-10-02 10:43 AM Re: Distributed net send type of app [Re: Radimus]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Quote:
I have spawned a number of cmd processes to manage the ping process for looking for live IPs (about 20 class c networks)

Phew! That's going to be a bit ugly, and pinging by it's nature is prone to false negatives.

Much easier to write to a central message file and get the clients to collect the message(s)

When you write a message to the file you timestamp it.

The clients poll the file every so often, and compare the timestamp to a local timestamp - if it is newer then all the messages with a more recent timestamp get displayed.

The client updates it's local timestamp to match the most recent message displayed.

The client timestamp would probably be stored in HKCU or a small text file in the user's profile.

Doing it this way has a number of major benefits:
  1. Processing load is distributed amongst the clients.
  2. Failure (or shutdown) of the transmitting server will not cause message delivery to fail.
  3. Clients which are shut down when the message is sent will get the message when they start up / log on.
  4. Messages can be more easily targetted at individuals or groups.
  5. You are less likely to miss clients due to temporary network issues - probably one of the reasons that you are sending the messages in the first place ;\)
  6. Messages can be given an expiry time, after which they are ignored.
  7. Optionally if the type of message can stand the extra delay the central file may be stored on a replicated file system and then accessed on the local server


I think that using this technique will be far more robust and far less resource intensive for your particular application.

BTW, don't forget to use UTC for timestamps.

Top
#181017 - 2007-10-02 12:51 PM Re: Distributed net send type of app [Re: Richard H.]
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I thought about that... using an ini file or similar as the host and then just let the clients "go fetch", but how much resources will 1500 PC polling for a file across a WAN use, when they check every 15 minutes for an updated message.

I was thinking that it would be less resource intensive to push the text file to the machine... when installing the client, create a hidden share. Then the admin tool could ping, check for share, then copy. The client would look every 5 minutes for a file, read it then delete it.

Personally, I wouldn't worry as much if I could use a DFS share, but the netadmin refuse to do set one up.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#181020 - 2007-10-02 01:36 PM Re: Distributed net send type of app [Re: Radimus]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Not sure about your environment, but now that I have end-users to deal with again, well, lets just say I have more grey hair now. (of what's left, that is) ;\)

One of the biggest issues I've encountered is some systems don't respond to ping, either because the netops team blocked ICMP at their remote router, the Windows firewall got turned on (yeah, we have GPOs to turn it off, but...), or the user installs some firewall like Black Ice or changes the McAfee settings and turns on the McAfee firewall. Our users are local admins - not my decision, but I have to live with it. Anyway, we've resorted to using XNET to check some service, like "UPS" - if it tells us anything other than "Remote machine not found", we're good to check the system and push updates, etc.

Bottom line, I'm very much in agreement with Richard about pull vs push. You could write a little routine to get the timestamp of \\server\service\message.ini. One quick burst on the net. Compare that with the timestamp with the last timestamp stored locally (.INI or registry to survive reboots) and display the message if needed. Your local routine to check and display could be a system service using SrvAny, and it could launch the local GUI to do the actual display once it detected the need. The service could determine and possibly retrieve the current message, minimizing the work done by the GUI.

With a service checking every 10-15 minutes, the network load would not be that great, nor concentrated. As a service, it determines the interval at startup, so the queries are spread out over a period of time. You could even wait a random amount of time between 10 and 15 mintes.

BTW - I've got several kix utilities running as services with SrvAny.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#181028 - 2007-10-02 02:39 PM Re: Distributed net send type of app [Re: Glenn Barnas]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Have you had a look at this thread and FileSystemWatcher?
http://www.kixforms.org/forum/viewtopic.php?t=1527
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#181031 - 2007-10-02 03:56 PM Re: Distributed net send type of app [Re: Les]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
You could take a look here, it was a long time ago and requires AutoIt but gets the job done Net Send Scripting

But when you want something centralized you have to look at sockets (.net implements socket support as well, just bother Shawn to add it) or use kixforms 2.x (find the chatclient and chatserver samples at shawn's board) or use an SQL/Access Database.

Top
#181041 - 2007-10-02 06:38 PM Re: Distributed net send type of app [Re: Arend_]
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I did the autoit to get net send in the past, but net send doesn't exist in Vista, and it isn't cross platform. You cannot use XP and net send to vista, and vista cannot net send to XP

Edited by Radimus (2007-10-02 06:38 PM)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#181047 - 2007-10-02 08:33 PM Re: Distributed net send type of app [Re: Radimus]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
I'm in agreement with Richard and Glenn for this.

If not all done with KiXtart then one of my fav utils RoboCopy can also run continuous and be set to look at given intervals for updates, but think a full KiXtart solution would be better.

As for load I don't think it would be that much of a load unless you have thousands of clients behind a 128K link in which case you probably have other more pressing issues.
Take a look sometime at how many calls your system (along with all the computers in your Org) go out and make calls to Microsoft or DNS lookups etc. Sniffing a system you'll see that it makes a ton of calls even though it seems quiet but the load impact is minimal considering how many systems are doing all this talking.

Top
#181073 - 2007-10-03 08:50 AM Re: Distributed net send type of app [Re: Radimus]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Thats weird, I can't imagine MS ditching the messenger service in Vista.
Top
#181074 - 2007-10-03 09:21 AM Re: Distributed net send type of app [Re: Arend_]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I'm not sure what you are using the messaging for, but I want to repeat a couple of my earlier points because if they are important to you they mean that you should *not* be looking for a net send type of application in the first place.

1) If the message is that important, you will want to ensure that any user who logs on within a certain time frame of the message being sent will still receive it. You cannot do this sensibly with a net send type application.

2) Any process which polls devices will fail to identify them all at some point. The network could be down or just congested. A firewall could be blocking the poll traffic. The polled service may be temporarily unresponsive.

Consider the case when you have a problem affecting all your users and they are swaping the support desk with calls. You might want to send a message somthing like:
 Quote:
The corporate network is experiencing intermittent short outages caused by a failing router. The failing switch will be replaced at 13:30. Please do not log a fault call unless you experience problems after this time


Now, if the fault is intermittent there is a chance that it is going to blow away many of your checks with "network unreachable" or a similar error.

If the clients are polling however, there is a much better chance that they will manage to pick up the message on one of their polls.

Top
#181109 - 2007-10-03 11:21 PM Re: Distributed net send type of app [Re: Richard H.]
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
1. I've decided that my best route is to get a /folder/file placed in netlogon with enough security that a file can be copied in from a limited group of people. Then have the clients poll %logonserver%\netlogon\folder\file.ini for the content of the message.

2. you could never send a message that contained, "The corporate network is experiencing intermittent short outages caused by a failing router. The failing switch will be replaced at 13:30. Please do not log a fault call unless you experience problems after this time", as most staff couldn't pronounce the terms in the message nor could understand the content. "There are intermittent connectivity problems preventing network communication. This problem should be resolved around 1:30 today. If you continue to experience this problem after that time, contact the help desk"

Thanks for the help and suggestions.


I'll provide code once the product is complete
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1577 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.125 seconds in which 0.088 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org