summaryrefslogtreecommitdiffstats
path: root/plugins/check_procs.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_procs.c')
-rw-r--r--plugins/check_procs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 2151fb3..d875a61 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -318,6 +318,8 @@ process_arguments (int argc, char **argv)
318 int err; 318 int err;
319 int cflags = REG_NOSUB | REG_EXTENDED; 319 int cflags = REG_NOSUB | REG_EXTENDED;
320 char errbuf[MAX_INPUT_BUFFER]; 320 char errbuf[MAX_INPUT_BUFFER];
321 char *temp_string;
322 int i=0;
321 static struct option longopts[] = { 323 static struct option longopts[] = {
322 {"warning", required_argument, 0, 'w'}, 324 {"warning", required_argument, 0, 'w'},
323 {"critical", required_argument, 0, 'c'}, 325 {"critical", required_argument, 0, 'c'},
@@ -450,7 +452,14 @@ process_arguments (int argc, char **argv)
450 regerror (err, &re_args, errbuf, MAX_INPUT_BUFFER); 452 regerror (err, &re_args, errbuf, MAX_INPUT_BUFFER);
451 die (STATE_UNKNOWN, "PROCS %s: %s - %s\n", _("UNKNOWN"), _("Could not compile regular expression"), errbuf); 453 die (STATE_UNKNOWN, "PROCS %s: %s - %s\n", _("UNKNOWN"), _("Could not compile regular expression"), errbuf);
452 } 454 }
453 asprintf (&fmt, "%s%sregex args '%s'", (fmt ? fmt : ""), (options ? ", " : ""), optarg); 455 /* Strip off any | within the regex optarg */
456 temp_string = strdup(optarg);
457 while(temp_string[i]!='\0'){
458 if(temp_string[i]=='|')
459 temp_string[i]=',';
460 i++;
461 }
462 asprintf (&fmt, "%s%sregex args '%s'", (fmt ? fmt : ""), (options ? ", " : ""), temp_string);
454 options |= EREG_ARGS; 463 options |= EREG_ARGS;
455 break; 464 break;
456 case 'r': /* RSS */ 465 case 'r': /* RSS */