diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_procs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 755ed860..e26e0ffb 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
| @@ -129,13 +129,12 @@ main (int argc, char **argv) | |||
| 129 | cols = 4; | 129 | cols = 4; |
| 130 | } | 130 | } |
| 131 | if ( cols >= 4 ) { | 131 | if ( cols >= 4 ) { |
| 132 | found++; | ||
| 133 | resultsum = 0; | 132 | resultsum = 0; |
| 134 | asprintf (&procargs, "%s", input_buffer + pos); | 133 | asprintf (&procargs, "%s", input_buffer + pos); |
| 135 | strip (procargs); | 134 | strip (procargs); |
| 136 | if ((options & STAT) && (strstr (statopts, procstat))) | 135 | if ((options & STAT) && (strstr (statopts, procstat))) |
| 137 | resultsum |= STAT; | 136 | resultsum |= STAT; |
| 138 | if ((options & ARGS) && procargs && (strstr (procargs, args) == procargs)) | 137 | if ((options & ARGS) && procargs && (strstr (procargs, args) != NULL)) |
| 139 | resultsum |= ARGS; | 138 | resultsum |= ARGS; |
| 140 | if ((options & PROG) && procprog && (strcmp (prog, procprog) == 0)) | 139 | if ((options & PROG) && procprog && (strcmp (prog, procprog) == 0)) |
| 141 | resultsum |= PROG; | 140 | resultsum |= PROG; |
| @@ -151,6 +150,10 @@ main (int argc, char **argv) | |||
| 151 | printf ("%d %d %d %s %s %s\n", procs, procuid, procppid, procstat, | 150 | printf ("%d %d %d %s %s %s\n", procs, procuid, procppid, procstat, |
| 152 | procprog, procargs); | 151 | procprog, procargs); |
| 153 | #endif | 152 | #endif |
| 153 | if (strcmp (procprog, progname) == 0) | ||
| 154 | continue; | ||
| 155 | found++; | ||
| 156 | |||
| 154 | if (options == resultsum) | 157 | if (options == resultsum) |
| 155 | procs++; | 158 | procs++; |
| 156 | } | 159 | } |
| @@ -491,7 +494,7 @@ print_help (void) | |||
| 491 | " -u, --user=USER\n" | 494 | " -u, --user=USER\n" |
| 492 | " Only scan for proceses with user name or ID indicated.\n" | 495 | " Only scan for proceses with user name or ID indicated.\n" |
| 493 | " -a, --argument-array=STRING\n" | 496 | " -a, --argument-array=STRING\n" |
| 494 | " Only scan for ARGS that match up to the length of the given STRING\n" | 497 | " Only scan for processes with args that contain STRING.\n" |
| 495 | " -C, --command=COMMAND\n" | 498 | " -C, --command=COMMAND\n" |
| 496 | " Only scan for exact matches to the named COMMAND.\n\n" | 499 | " Only scan for exact matches to the named COMMAND.\n\n" |
| 497 | "RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n" | 500 | "RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n" |
