diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-08 12:39:08 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-08 12:39:08 +0100 |
| commit | 99bb7dd0f8f6962e12a3b0e4cd8bab0ebb278f0f (patch) | |
| tree | 3458b9708f3c25e531de5e93e017652b55a5010a | |
| parent | 5130e5b0d3591866488bd03b00ca383cd7674b3c (diff) | |
| download | monitoring-plugins-99bb7dd0f8f6962e12a3b0e4cd8bab0ebb278f0f.tar.gz | |
check_procs: delare file local variables static
| -rw-r--r-- | plugins/check_procs.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 5777ba07..53c93c0b 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) { |
