[Nagiosplug-checkins] CVS: nagiosplug/plugins check_procs.c,1.9,1.9.2.1

Ton Voon tonvoon at users.sourceforge.net
Fri Apr 11 17:03:08 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv11122

Modified Files:
      Tag: r1_3_0
	check_procs.c 
Log Message:
Match -a STRING anywhere in ps args (Laurent Vaslin - 719783)


Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** check_procs.c	31 Jan 2003 18:40:40 -0000	1.9
--- check_procs.c	12 Apr 2003 00:02:15 -0000	1.9.2.1
***************
*** 130,134 ****
  		}
  		if ( cols >= 4 ) {
- 			found++;
  			resultsum = 0;
  			asprintf (&procargs, "%s", input_buffer + pos);
--- 130,133 ----
***************
*** 136,140 ****
  			if ((options & STAT) && (strstr (statopts, procstat)))
  				resultsum |= STAT;
! 			if ((options & ARGS) && procargs && (strstr (procargs, args) == procargs))
  				resultsum |= ARGS;
  			if ((options & PROG) && procprog && (strcmp (prog, procprog) == 0))
--- 135,139 ----
  			if ((options & STAT) && (strstr (statopts, procstat)))
  				resultsum |= STAT;
! 			if ((options & ARGS) && procargs && (strstr (procargs, args) != NULL))
  				resultsum |= ARGS;
  			if ((options & PROG) && procprog && (strcmp (prog, procprog) == 0))
***************
*** 152,155 ****
--- 151,158 ----
  								procprog, procargs);
  #endif
+ 			if (strcmp (procprog, progname) == 0)
+ 				continue;
+ 			found++;
+ 
  			if (options == resultsum)
  				procs++;
***************
*** 492,496 ****
  		 "    Only scan for proceses with user name or ID indicated.\n"
  		 " -a, --argument-array=STRING\n"
! 		 "    Only scan for ARGS that match up to the length of the given STRING\n"
  		 " -C, --command=COMMAND\n"
  		 "    Only scan for exact matches to the named COMMAND.\n\n"
--- 495,499 ----
  		 "    Only scan for proceses with user name or ID indicated.\n"
  		 " -a, --argument-array=STRING\n"
! 		 "    Only scan for processes with args that contain STRING.\n"
  		 " -C, --command=COMMAND\n"
  		 "    Only scan for exact matches to the named COMMAND.\n\n"





More information about the Commits mailing list