Ad Widget

Collapse

Feature Request: PID Check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • azilber
    Member
    • Apr 2005
    • 33

    #1

    Feature Request: PID Check

    For version 1.1 (and up), it would be great to have something like:

    proc.pid[<pid file>,<optional process name>]

    Will a) check if the pid is a process and
    b) if the optional process name exists, checks to make sure it matches the actual process name.

    and

    proc.pid.exists[<pid>,<optional process name>]

    Same as above except you supply the pid. Not as usefull, but might be for some..
  • abi
    Member
    • Jun 2006
    • 81

    #2
    Why not creating a UserCommand and use `pgrep' from the procutils?

    Code:
    abi@kida:~$ pgrep firefox-bin
    29928
    anyway, monitoring a single pid may be quite useless because they
    change anyway (after process restart), btw. on threaded programs
    it doesnt make much sense.

    Comment

    • Fotis
      Junior Member
      • Sep 2014
      • 24

      #3
      perf_counter["\Process(process name)\ID process"]

      Comment

      • barbaros
        Member
        • Aug 2010
        • 32

        #4
        Guys, is there a simple way to monitor process existence, knowing only the PID, not it's name. The issue is that I have couple of processes, which have the same names, but I need to monitor them all (not just existence of process_name, but existence of every process process_name. I have their PIDs, taken from pidfiles in /var/run directory.

        Of course, it's no problem to use UserCommand and some simple script but maybe there is a better/different way.

        Comment

        • barbaros
          Member
          • Aug 2010
          • 32

          #5
          OK, the solution with UserParameter is sufficient.

          Code:
          UserParameter=proc.num.XXX[*],ps acx | grep ^$(cat /var/run/XXX-"$1".pid) | wc -l

          Comment

          Working...