summaryrefslogtreecommitdiffstats
path: root/web/attachments/119194-check_procs.patch
blob: 35104833c3181732a38c066fff4493a16d60cf72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
*** 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))