Russ,
I am not a Perl pro (average hacker myself ;-) but what you are
experiencing seems very much like a memory error of some sort.
Possibly undef'ing your arrays and variables between iterations (before you
start checking each PC).
I know Perl has a habit of increasing its memory footprint when running
iterative processes over a large number of targets. Hmmm I know I am being
very sketchy - but this reminds me of a similar post some months (possibly
years) back. I just dont have the detail or experience avaliable to advise
you.
Keep an eye out for responses from the pro's
Hope you get it sorted out ;-)
---------------------------------------------
Jonathan Hughes
Technical Support Specialist
Goodyear South Africa
---------------------------------------------
MCSD / MCP
Registered Linux User # 362669
==============================================================================
Skill is successfully walking a tightrope over Niagara Falls. Intelligence
is not trying.
-Anonymous
==============================================================================
Russ Gray
<[EMAIL PROTECTED]> To: Activestate Perl
Sent by: <[EMAIL PROTECTED]>
[EMAIL PROTECTED] cc:
veState.com Subject: Perl crashing
when listing processes on remote
machines.
08/05/04 06:58 AM
Hello list,
I need to be able to procude a list of all running processes on each
machine in a particular domain. I have a script that is capable of
enumerating all machines on that domain, and for each machine listing
the processes - but after doing just a couple of machines the perl
interpreter crashes out and I get the MS Error Reporter dialog. I'm
running XP Pro, the PDC is Windows 2000 Server, and the machines I'm
auditing are all W2K Pro or XP Pro. Here is my script:
=====================================================================
use strict;
use Win32::Lanman;
use Win32::Process::Info;
my $server = "my_pdc";
my $domain = "my_domain";
my @info = ();
Win32::Lanman::NetServerEnum($server, $domain, SV_TYPE_NT, [EMAIL PROTECTED]);
foreach my $machine(@info) {
print $machine->{'name'}.":\n";
eval {
print "DEBUG: Calling Info->new()...\n";
my $pi = Win32::Process::Info->new($machine->{'name'});
print "DEBUG: Calling GetProcInfo()...\n";
my @procs = $pi->GetProcInfo();
foreach my $pid(@procs) {
print "\t".$pid->{Name}."\n";
}
};
}
====================================================================
The eval block is just so that the script doesn't stop if any of the
machines are switched off.
The script runs in a domain administrator shell:
runas /user:my_domain\domain_admin "cmd"
The Event Log record says:
====================================================================
Event Type: Error
Event Source: Application Error
Event Category: None
Event ID: 1000
Date: 04/08/2004
Time: 16:27:52
User: N/A
Computer: XDADEV
Description:
Faulting application perl.exe, version 5.8.0.805, faulting module
ole32.dll, version 5.1.2600.1106, fault address 0x0002aa9c.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 70 65 72 ure per
0018: 6c 2e 65 78 65 20 35 2e l.exe 5.
0020: 38 2e 30 2e 38 30 35 20 8.0.805
0028: 69 6e 20 6f 6c 65 33 32 in ole32
0030: 2e 64 6c 6c 20 35 2e 31 .dll 5.1
0038: 2e 32 36 30 30 2e 31 31 .2600.11
0040: 30 36 20 61 74 20 6f 66 06 at of
0048: 66 73 65 74 20 30 30 30 fset 000
0050: 32 61 61 39 63 0d 0a 2aa9c..
====================================================================
If I modify the script to run against any single machine of my choice,
it works perfectly - it's only when I try to run in a loop that I get
the error. The actual error occurs on a call to
Win32::Process::Info->new().
Anyone got any ideas?
TIA,
Russ.
(See attached file: C.DTF)
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
C.DTF
Description: Binary data
_______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
