Getting access to the process table from python?

Discussion in 'Python' started by Roy Smith, Jan 13, 2010.

  1. Roy Smith

    Roy Smith Guest

    I need to get information about what processes are running on a box.
    Right now, I'm interested in Solaris and Linux, but eventually
    probably other systems too. I need to know things like the pid,
    command line, CPU time, when the process started running, and owner.

    Has anybody written a module to do this? I know I can run ps and
    parse the output, or troll /proc directly, but if somebody's already
    written all that, I'd rather not reinvent the wheel.
     
    Roy Smith, Jan 13, 2010
    #1
    1. Advertising

  2. Roy Smith

    Aahz Guest

    In article <>,
    Roy Smith <> wrote:
    >
    >I need to get information about what processes are running on a box.
    >Right now, I'm interested in Solaris and Linux, but eventually
    >probably other systems too. I need to know things like the pid,
    >command line, CPU time, when the process started running, and owner.
    >
    >Has anybody written a module to do this? I know I can run ps and
    >parse the output, or troll /proc directly, but if somebody's already
    >written all that, I'd rather not reinvent the wheel.


    Google "python process table"?
    --
    Aahz () <*> http://www.pythoncraft.com/

    "If you think it's expensive to hire a professional to do the job, wait
    until you hire an amateur." --Red Adair
     
    Aahz, Jan 13, 2010
    #2
    1. Advertising

  3. On Jan 13, 1:41 pm, Roy Smith <> wrote:
    > I need to get information about what processes are running on a box.
    > Right now, I'm interested in Solaris and Linux, but eventually
    > probably other systems too.  I need to know things like the pid,
    > command line, CPU time, when the process started running, and owner.
    >
    > Has anybody written a module to do this?  I know I can run ps and
    > parse the output, or troll /proc directly, but if somebody's already
    > written all that, I'd rather not reinvent the wheel.


    You might visit the Cheeseshop and search for "process table" there.
    Searching there, I see one good hit that looks like what you're after.

    ---John
     
    John Gabriele, Jan 13, 2010
    #3
  4. Roy Smith

    Terry Reedy Guest

    On 1/13/2010 1:41 PM, Roy Smith wrote:
    > I need to get information about what processes are running on a box.
    > Right now, I'm interested in Solaris and Linux, but eventually
    > probably other systems too. I need to know things like the pid,
    > command line, CPU time, when the process started running, and owner.
    >
    > Has anybody written a module to do this? I know I can run ps and
    > parse the output, or troll /proc directly, but if somebody's already
    > written all that, I'd rather not reinvent the wheel.


    Did you try google or pypi?
     
    Terry Reedy, Jan 13, 2010
    #4
  5. 2010/1/13 Roy Smith <>:
    > I need to get information about what processes are running on a box.
    > Right now, I'm interested in Solaris and Linux, but eventually
    > probably other systems too.  I need to know things like the pid,
    > command line, CPU time, when the process started running, and owner.
    >
    > Has anybody written a module to do this?  I know I can run ps and
    > parse the output, or troll /proc directly, but if somebody's already
    > written all that, I'd rather not reinvent the wheel.


    <http://www.psychofx.com/psi/>

    --
    Cheers,
    Simon B.
     
    Simon Brunning, Jan 14, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rithesh Pai
    Replies:
    1
    Views:
    5,617
  2. Jerry
    Replies:
    4
    Views:
    5,985
    Marina
    Dec 15, 2003
  3. Ponnurangam
    Replies:
    1
    Views:
    2,991
    Kevin Spencer
    Oct 20, 2004
  4. bala
    Replies:
    2
    Views:
    8,744
  5. Joe Van Dyk
    Replies:
    6
    Views:
    183
    Csaba Henk
    Apr 2, 2005
Loading...

Share This Page