nagios-plugins/nagios-plugins — pull request #25 by yath (2012-11-07 18:07:00+00:00)
Title: check_procs: Use /proc/pid/exe, when available, instead of getpid() for filtering out self

Make check_procs filter out itself in the process list by comparing the
file pointed to by /proc/pid/exe. On platforms where this is not
available or when check_procs is passed the -T flag, the old behaviour
(check whether PID equals getpid()) is retained.

This fixes some false alarms when e.g. Nagios has, for whatever reasons,
some backlog of checks to run and check_procs with -a is called more
than once in a short time, matching its sister process.