in reply to Re: Re: Non-blocking pings on Win32
in thread Non-blocking pings on Win32
The design is that each child runs independantly and when it dies the parent reaps it. Depending on the return status of the child that died the parent either continues on to reap another, or sends and SNMP trap.
The second program on my scratchpad however is much more resource friendly. It preforks a number of child processes which do not exit. The list of destination information is handed out one by one to the child processes and if they fail they are logged to a database via another processes. There is yet another child processes who's only job is to monitor the database of failures and report in whatever you set to be a failure (7 failures in 10 minutes, etc) and clean out the old entries.
Since the child processes all stay running the parent which hands out the IP's logs what time each was handed out and will only hand it out once every 60 seconds. What happens is that due to failures and other latency the program balances itself out over time. This has the effect of spreading out the pings over the 60 second (configurable) interval to lessen the load on the server as well as the network.
Let me know if you have any more questions on this second program. It will probably have much more work to port to a Win platform though.
Have you ever considered running this in cygwin? Is there a *nix box you could put it on? Just because you are checking windows boxes dosen't mean all your tools have to run on one.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Non-blocking pings on Win32
by TheFluffyOne (Beadle) on Nov 25, 2003 at 18:49 UTC |