I have been working on a Perl script that will kill a Windows Process if 
it has been running for an x amount of time.  This script will run on a 
Windows Platform.


pslist is a tool that can be retrieved from 
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
the output from pslist EXCEL looks like:
        C:\Tivoli\lcf\bin\w32-ix86\tools>pslist EXCEL

PsList 1.23 - Process Information Lister
Copyright (C) 1999-2002 Mark Russinovich
Sysinternals - www.sysinternals.com

Process information for CRP-DAY1-S75410:

Name          Pid Pri Thd  Hnd    Mem    User Time   Kernel Time   Elapsed 
Time
EXCEL        2936   8   2  131  16240  0:00:00.015   0:00:00.453 
0:00:13.609


>From Script:
$lcf_tools = $ENV{LCF_TOOLSDIR};
@temparry = `"$lcf_tools\\pslist EXCEL"`;
foreach $temp (@temparray){
 ($name,$pid,$pri,$thd,$hnd,$Mem,$usertime,$kerneltime,$elapsedtime) = 
split(" ",$temp);
        print LOGFILE "name is $name";
        &AnalyzeProcess($name,$elapsedtime);
        }

###&AnalyzeProcess  ---> this will decide to kill the process or
 keep it running

I am having issues getting my array filled, or does someone else already 
have a script that does something very similar to what I am wanting to do.

Anthony J Segelhorst
Enterprise Systems Management Team
Phone: 937-495-1876
Email: [EMAIL PROTECTED]

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service._______________________________________________________________

Note:  Please update your email address for this user to reflect the
new MeadWestvaco Corporation.  MeadWestvaco employee email addresses
are in the format of [EMAIL PROTECTED] 

This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure.  The
information is intended to be used solely by the recipient(s)
named.  If you are not an intended recipient, be aware that
any review, disclosure, copying, distribution or use of this
transmission or its contents is prohibited.  If you have
received this transmission in error, please notify MeadWestvaco
immediately at [EMAIL PROTECTED]
_______________________________________________________________________

Reply via email to