P
Patrick Paquet
Hello everyone,
I've been working on a script that fetches information from all
workstations on our NT domain, the problem I've now run into at this
point is that it takes a very long time to execute completely. The
reason for this is probably simply because I'm checking each machine
in sequence (I check machine A, and only when I'm done do I move on to
B etc).
I've been looking into running these checks in parallel, via the
Win32:rocess module, but I haven't found a way to control the
number of simultaneous processes adequately. I can launch a certain
number of them, but I can't figure out how to check the status of a
process and to lower a counter when it's done, so that I can launch
another one to replace it. What I'm looking to do is lauch no more
then 10 (for example) instances of the script, and to stay as close to
that without going over as long as there are machines to check.
Making sense?
I have been looking thru this group and various ressources on the net
(thank you Dave Roth!) on and off for well over 2 weeks now, but
haven't made much headway (although as usual I've picked up a couple
of things along the way).
I am open to alternatives as to how I can achieve this as well, I'm
not dead set on Win32:rocess, so if you have ideas or suggestions,
I'm interested. My current method generates several text files with
listings of machines to check, and launches the script via the system
command attaching the file as an argument, but I'm sure there's a more
elegant way to do this, and I'm also pretty sure that it's not as
difficult as it seems, but for now the solution escapes me.
My current script is fully functionnal as far as the workstation
checks are concerned. It is also a bit lengthy (+750 lines) so I
won't post it here for brevity's sake. At this point it doesn't even
include the Win32:rocess module as I just haven't been able to do
much with it at all, besides launching or (way too) many processes.
What I'm really asking for (after all this...) is some pointers and
simple examples (if possible) as to how I can check the status of the
processes and launch a new process on exit from the previous one.
I'm running ActiveState Perl 5.005_02, and cannot upgrade it. Many
scripts are run centrally and I don't have authority to do the upgrade
on the script server.
Thanks in advance for any assistance, suggestions, pearls of wisdow
and all the fish!
Patrick PAQUET
I've been working on a script that fetches information from all
workstations on our NT domain, the problem I've now run into at this
point is that it takes a very long time to execute completely. The
reason for this is probably simply because I'm checking each machine
in sequence (I check machine A, and only when I'm done do I move on to
B etc).
I've been looking into running these checks in parallel, via the
Win32:rocess module, but I haven't found a way to control the
number of simultaneous processes adequately. I can launch a certain
number of them, but I can't figure out how to check the status of a
process and to lower a counter when it's done, so that I can launch
another one to replace it. What I'm looking to do is lauch no more
then 10 (for example) instances of the script, and to stay as close to
that without going over as long as there are machines to check.
Making sense?
I have been looking thru this group and various ressources on the net
(thank you Dave Roth!) on and off for well over 2 weeks now, but
haven't made much headway (although as usual I've picked up a couple
of things along the way).
I am open to alternatives as to how I can achieve this as well, I'm
not dead set on Win32:rocess, so if you have ideas or suggestions,
I'm interested. My current method generates several text files with
listings of machines to check, and launches the script via the system
command attaching the file as an argument, but I'm sure there's a more
elegant way to do this, and I'm also pretty sure that it's not as
difficult as it seems, but for now the solution escapes me.
My current script is fully functionnal as far as the workstation
checks are concerned. It is also a bit lengthy (+750 lines) so I
won't post it here for brevity's sake. At this point it doesn't even
include the Win32:rocess module as I just haven't been able to do
much with it at all, besides launching or (way too) many processes.
What I'm really asking for (after all this...) is some pointers and
simple examples (if possible) as to how I can check the status of the
processes and launch a new process on exit from the previous one.
I'm running ActiveState Perl 5.005_02, and cannot upgrade it. Many
scripts are run centrally and I don't have authority to do the upgrade
on the script server.
Thanks in advance for any assistance, suggestions, pearls of wisdow
and all the fish!
Patrick PAQUET