summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_disk.c83
1 files changed, 34 insertions, 49 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 24de2d4..b3dd301 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -119,44 +119,41 @@ enum
119#pragma alloca 119#pragma alloca
120#endif 120#endif
121 121
122int process_arguments (int, char **); 122static int process_arguments (int, char **);
123void print_path (const char *mypath); 123static void set_all_thresholds (struct parameter_list *path);
124void set_all_thresholds (struct parameter_list *path); 124static void print_help (void);
125int validate_arguments (uintmax_t, uintmax_t, double, double, double, double, char *);
126void print_help (void);
127void print_usage (void); 125void print_usage (void);
128double calculate_percent(uintmax_t, uintmax_t); 126static double calculate_percent(uintmax_t, uintmax_t);
129bool stat_path (struct parameter_list *p); 127static bool stat_path (struct parameter_list *p);
130void get_stats (struct parameter_list *p, struct fs_usage *fsp); 128static void get_stats (struct parameter_list *p, struct fs_usage *fsp);
131void get_path_stats (struct parameter_list *p, struct fs_usage *fsp); 129static void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
132 130
133char *exclude_device; 131static char *units;
134char *units; 132static uintmax_t mult = 1024 * 1024;
135uintmax_t mult = 1024 * 1024; 133static int verbose = 0;
136int verbose = 0; 134static bool erronly = false;
137bool erronly = false; 135static bool display_mntp = false;
138bool display_mntp = false; 136static bool exact_match = false;
139bool exact_match = false; 137static bool ignore_missing = false;
140bool ignore_missing = false; 138static bool freespace_ignore_reserved = false;
141bool freespace_ignore_reserved = false; 139static bool display_inodes_perfdata = false;
142bool display_inodes_perfdata = false; 140static char *warn_freespace_units = NULL;
143char *warn_freespace_units = NULL; 141static char *crit_freespace_units = NULL;
144char *crit_freespace_units = NULL; 142static char *warn_freespace_percent = NULL;
145char *warn_freespace_percent = NULL; 143static char *crit_freespace_percent = NULL;
146char *crit_freespace_percent = NULL; 144static char *warn_usedspace_units = NULL;
147char *warn_usedspace_units = NULL; 145static char *crit_usedspace_units = NULL;
148char *crit_usedspace_units = NULL; 146static char *warn_usedspace_percent = NULL;
149char *warn_usedspace_percent = NULL; 147static char *crit_usedspace_percent = NULL;
150char *crit_usedspace_percent = NULL; 148static char *warn_usedinodes_percent = NULL;
151char *warn_usedinodes_percent = NULL; 149static char *crit_usedinodes_percent = NULL;
152char *crit_usedinodes_percent = NULL; 150static char *warn_freeinodes_percent = NULL;
153char *warn_freeinodes_percent = NULL; 151static char *crit_freeinodes_percent = NULL;
154char *crit_freeinodes_percent = NULL; 152static bool path_selected = false;
155bool path_selected = false; 153static bool path_ignored = false;
156bool path_ignored = false; 154static char *group = NULL;
157char *group = NULL; 155static struct stat *stat_buf;
158struct stat *stat_buf; 156static struct name_list *seen = NULL;
159struct name_list *seen = NULL;
160 157
161 158
162int 159int
@@ -899,18 +896,6 @@ process_arguments (int argc, char **argv)
899 return true; 896 return true;
900} 897}
901 898
902
903
904void
905print_path (const char *mypath)
906{
907 if (mypath == NULL)
908 printf ("\n");
909 else
910 printf (_(" for %s\n"), mypath);
911}
912
913
914void 899void
915set_all_thresholds (struct parameter_list *path) 900set_all_thresholds (struct parameter_list *path)
916{ 901{