*** check_procs.c.orig Wed Dec 29 16:41:39 2004 --- check_procs.c Tue Feb 8 10:42:34 2005 *************** *** 187,197 **** procppid, procpcpu, procstat, procetime, procprog, procargs); ! /* Ignore self */ if (strcmp (procprog, progname) == 0) { continue; } if ((options & STAT) && (strstr (statopts, procstat))) resultsum |= STAT; if ((options & ARGS) && procargs && (strstr (procargs, args) != NULL)) --- 187,204 ---- procppid, procpcpu, procstat, procetime, procprog, procargs); ! /* Ignore command line self */ ! if (strcmp (procprog, progname) == 0) { continue; } + /* Ignore self in process arguments to prevent problems when + check_procs is called via shell (i.e. check_nrpe) */ + + if (strstr (procargs, progname) != NULL) + continue; + if ((options & STAT) && (strstr (statopts, procstat))) resultsum |= STAT; if ((options & ARGS) && procargs && (strstr (procargs, args) != NULL))