Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

OT: View current running programs - basic admin scripting!!

by Chad_MacArthur (Initiate)
on Apr 28, 2004 at 13:59 UTC ( [id://348824]=perlquestion: print w/replies, xml ) Need Help??

Chad_MacArthur has asked for the wisdom of the Perl Monks concerning the following question:

G'day guys

I was wondering what kind of system commands I would use to write a program that takes 2 switch + agruments:

  1. for memory plus the memory time eg. -m 85 which finds any processes that amount or over then kills it, Displaying the name of process killed.
  2. for cpu time plus the cpu time eg. -c 97 which finds any processes that amount or over then kills it, Displaying the name of process killed.
If it does find a process that is using alot of cpu time or memory it then kills it. It sends an email to the owner of the process

Thank mate for the Help
ANy help would be Great
Chad

20040501 Edit by jdporter: Changed title from 'View current running programs - basic admin scripting!!'

Replies are listed 'Best First'.
Re: OT: View current running programs basic admin scripting!!
by Fletch (Bishop) on Apr 28, 2004 at 15:02 UTC
Re: OT: View current running programs basic admin scripting!!
by dragonchild (Archbishop) on Apr 28, 2004 at 14:04 UTC
    On Unix-like systems, I'd look at the ps command. On Windows, you'll have to play with the Win32:: suite. For other OS'es, I'm sure the solutions are there, but I have no clue what to do.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

Re: OT: View current running programs basic admin scripting!!
by Abigail-II (Bishop) on Apr 28, 2004 at 14:04 UTC
    I'd use ps, or browse the /proc file system.

    Abigail

Re: OT: View current running programs - basic admin scripting!!
by AcidHawk (Vicar) on Apr 29, 2004 at 07:11 UTC
    Check Proclist.pl from www.roth.net for a script that list the process and some other info.
    -----
    Of all the things I've lost in my life, its my mind I miss the most.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://348824]
Approved by matija
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found