diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-08 23:04:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-08 23:04:19 +0100 |
| commit | b370072a5a1e21876abf8cf95f4622c02565ae07 (patch) | |
| tree | 5856b120cba767922c8af0cf9d9b25c48bb32ed9 /plugins/check_procs.c | |
| parent | ef39064f5148d96a6923f60a2fadd12810fcfa06 (diff) | |
| parent | e8905c9e9c96b5b57f64edf0d5c7429aa39341b8 (diff) | |
| download | monitoring-plugins-b370072a5a1e21876abf8cf95f4622c02565ae07.tar.gz | |
Merge pull request #2043 from RincewindsHat/cleanup/leftovers
Cleanup/leftovers
Diffstat (limited to 'plugins/check_procs.c')
| -rw-r--r-- | plugins/check_procs.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 5777ba07..1d78ccee 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
| @@ -51,17 +51,17 @@ const char *email = "devel@monitoring-plugins.org"; | |||
| 51 | #include <sys/stat.h> | 51 | #include <sys/stat.h> |
| 52 | #endif | 52 | #endif |
| 53 | 53 | ||
| 54 | int process_arguments (int, char **); | 54 | static int process_arguments (int /*argc*/, char ** /*argv*/); |
| 55 | int validate_arguments (void); | 55 | static int validate_arguments (void); |
| 56 | int convert_to_seconds (char *); | 56 | static int convert_to_seconds (char * /*etime*/); |
| 57 | void print_help (void); | 57 | static void print_help (void); |
| 58 | void print_usage (void); | 58 | void print_usage (void); |
| 59 | 59 | ||
| 60 | char *warning_range = NULL; | 60 | static char *warning_range = NULL; |
| 61 | char *critical_range = NULL; | 61 | static char *critical_range = NULL; |
| 62 | thresholds *procs_thresholds = NULL; | 62 | static thresholds *procs_thresholds = NULL; |
| 63 | 63 | ||
| 64 | int options = 0; /* bitmask of filter criteria to test against */ | 64 | static int options = 0; /* bitmask of filter criteria to test against */ |
| 65 | #define ALL 1 | 65 | #define ALL 1 |
| 66 | #define STAT 2 | 66 | #define STAT 2 |
| 67 | #define PPID 4 | 67 | #define PPID 4 |
| @@ -89,27 +89,25 @@ enum metric { | |||
| 89 | }; | 89 | }; |
| 90 | enum metric metric = METRIC_PROCS; | 90 | enum metric metric = METRIC_PROCS; |
| 91 | 91 | ||
| 92 | int verbose = 0; | 92 | static int verbose = 0; |
| 93 | int uid; | 93 | static int uid; |
| 94 | pid_t ppid; | 94 | static pid_t ppid; |
| 95 | int vsz; | 95 | static int vsz; |
| 96 | int rss; | 96 | static int rss; |
| 97 | float pcpu; | 97 | static float pcpu; |
| 98 | char *statopts; | 98 | static char *statopts; |
| 99 | char *prog; | 99 | static char *prog; |
| 100 | char *exclude_progs; | 100 | static char *exclude_progs; |
| 101 | char **exclude_progs_arr = NULL; | 101 | static char **exclude_progs_arr = NULL; |
| 102 | char exclude_progs_counter = 0; | 102 | static char exclude_progs_counter = 0; |
| 103 | char *args; | 103 | static char *args; |
| 104 | char *input_filename = NULL; | 104 | static char *input_filename = NULL; |
| 105 | regex_t re_args; | 105 | static regex_t re_args; |
| 106 | char *fmt; | 106 | static char *fmt; |
| 107 | char *fails; | 107 | static char *fails; |
| 108 | char tmp[MAX_INPUT_BUFFER]; | 108 | static char tmp[MAX_INPUT_BUFFER]; |
| 109 | int kthread_filter = 0; | 109 | static int kthread_filter = 0; |
| 110 | int usepid = 0; /* whether to test for pid or /proc/pid/exe */ | 110 | static int usepid = 0; /* whether to test for pid or /proc/pid/exe */ |
| 111 | |||
| 112 | FILE *ps_input = NULL; | ||
| 113 | 111 | ||
| 114 | static int | 112 | static int |
| 115 | stat_exe (const pid_t pid, struct stat *buf) { | 113 | stat_exe (const pid_t pid, struct stat *buf) { |
| @@ -834,7 +832,7 @@ be the total number of running processes\n\n")); | |||
| 834 | printf (" %s\n", "check_procs -w 50000 -c 100000 --metric=VSZ"); | 832 | printf (" %s\n", "check_procs -w 50000 -c 100000 --metric=VSZ"); |
| 835 | printf (" %s\n\n", _("Alert if VSZ of any processes over 50K or 100K")); | 833 | printf (" %s\n\n", _("Alert if VSZ of any processes over 50K or 100K")); |
| 836 | printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU"); | 834 | printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU"); |
| 837 | printf (" %s\n", _("Alert if CPU of any processes over 10\% or 20\%")); | 835 | printf (" %s\n", _("Alert if CPU of any processes over 10%% or 20%%")); |
| 838 | 836 | ||
| 839 | printf (UT_SUPPORT); | 837 | printf (UT_SUPPORT); |
| 840 | } | 838 | } |
