3 Replies Latest reply: Apr 30, 2009 10:47 AM by dougm_hyperic RSS

Find child processes

mah431 Hot Shot
Currently Being Moderated
Hi all,

Given a PID, how can I find all the child processes using SIGAR?

Kind regards,

Mohammed
  • 1. Re: Find child processes
    laullon Hot Shot
    Currently Being Moderated
    Use this query:
    State.Ppid.eq={PID}
  • 2. Re: Find child processes
    diogenesgg Hot Shot
    Currently Being Moderated
    Hi all,

    but using the sigar object, how can I get all child process (pids would be enough) from a given pid ?

    I've used the method sigar.getMultiProcCpu("queryPTQL") but I haven't found a usefull "query" neither I know what I can do with the MultiProcCpu object.

    thanks.

    Diógenes
  • 3. Re: Find child processes
    dougm_hyperic Expert
    Currently Being Moderated
    Hi,

    You can use ptql in any of the Sigar.get*Proc*(String) methods including MultiProcCpu.  For example, listing the children of my screen process:

    % java -jar sigar.jar ps State.Name.Peq=screen,CredName.User.eq=dougm
    7054    dougm   Mar14    55M    1.3M    1.2M    S       0:0     /bin/bash
    7074    dougm   Mar14    55M    1.7M    1.2M    S       0:4     /bin/bash
    7736    dougm   Mar17    55M    1.5M    1.2M    S       0:1     /bin/bash
    17472   dougm   Mar17    55M    1.6M    1.2M    S       0:0     /bin/bash
    16603   dougm   Apr7     55M    1.3M    1.2M    S       0:0     /bin/bash

    And with 'mps' which tests the Multi methods:
    % java -jar sigar.jar mps State.Name.Peq=screen,CredName.User.eq=dougm
    Number of processes: 5
    Cpu usage: 0.0%
    Cpu time: 0:6
    Size: 275M
    Resident: 7.4M
    Share: 6.0M

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 6 points

Share This Page